1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Bootstrapping and R

  1. Apr 24, 2013 #1
    1. The problem statement, all variables and given/known data

    I have the code:







    And I want to compute this M times for y=8,n=7,sigma=2,a=3,b=1,N=1000,M=10000.

    2. Relevant equations

    3. The attempt at a solution

    So this is what I wrote:

    >my.sample<-delta(8, 7, 2,3,1,1000)



    +for(i in 1:M)



    >x<-sample(delta, 10000, replace=TRUE)


    But I keep getting errors, so I must be doing something wrong but I'm not sure what.

    In other words, this is how it looks like in R:

    > my.sample<-delta(8, 7, 2,3,1,1000)
    Error in delta(8, 7, 2, 3, 1, 1000) : attempt to apply non-function
    > M<-10000
    > M;d<-numeric(M)
    [1] 10000
    > for(i in 1:M)
    + d=delta(y,n,sigma,a,b,N)
    Error in rlogis(N, a, b) : object 'N' not found
    > {
    + x<-sample(delta, 10000, replace=TRUE)
    + M;d<-mean(x)}
    Error in x[.Internal(sample(length(x), size, replace, prob))] :
    object of type 'closure' is not subsettable

    I've been trying to fix this for a long time, and it's really frustrating...any help would be appreciated.

    Thanks in advance
  2. jcsd
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Can you offer guidance or do you also need help?
Draft saved Draft deleted