My Math Forum  

Go Back   My Math Forum > College Math Forum > Advanced Statistics

Advanced Statistics Advanced Probability and Statistics Math Forum

LinkBack Thread Tools Display Modes
April 24th, 2013, 05:04 PM   #1
Joined: May 2012

Posts: 56
Thanks: 0

Bootstrapping and R

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.

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[i]=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[i]<-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
Artus is offline  

  My Math Forum > College Math Forum > Advanced Statistics


Thread Tools
Display Modes

Copyright © 2018 My Math Forum. All rights reserved.