[R] Need help with error number of items to replace is not a multiple of replacement length

monica1221 monica1221 at gmail.com
Mon Sep 6 23:39:45 CEST 2010


Hello, I am brand new to R and need a little help understanding what I'm
doing wrong here! Please excuse me, I might have the terminology incorrect.

What I've got is: A dataset ami07.data with a variable ami_fy07. There are
2929 values in this dataset, each representing a value for a unique
hospital.

What I would like to do is: Resample with replacement 4000 times
(eventually) each sample having 2929 values, calculate a value from each
sample, and then calculate a confidence interval.  Right now, I'm stuck at
the first part. 

This is what I did:
samplefunction = function(x, d) {
  return(x[d])
}

for (i in 1:2929)
{
		b[i]=boot(ami_fy07,samplefunction, R=1000)

}


I'm getting an error: 
In b[i] =boot(ami_fy07, samplefunction, R = 1000): number of items to
replace is not a multiple of replacement length.

If this is not clear enough, please let me know and I'll provide more
information. Thank you!!
 
-- 
View this message in context: http://r.789695.n4.nabble.com/Need-help-with-error-number-of-items-to-replace-is-not-a-multiple-of-replacement-length-tp2528901p2528901.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list