monica1221
2010-Sep-06 21:39 UTC
[R] Need help with error number of items to replace is not a multiple of replacement length
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.
Reasonably Related Threads
- bootstrapping error message "Error in t.star[r, ] <- statistic(data, i[r, ], ...) : number of items to replace is not a multiple of replacement length"
- number of items to replace is not a multiple of replacement length
- number of items to replace is not a multiple of replacement length
- Error message: number of items to replace is not a multiple of replacement length
- Weibull simulation- number of items to replace is not a multiple of replacement length