r,sample,replicate,statistics-bootstrap

I believe you can do this by making a small change to your code as so. extractDiff <- function(P){ sampleset = sample(nrow(P), 15, replace=FALSE) #select the first 15 rows, note replace=FALSE subA <- P[sampleset, ] # takes the 15 selected rows subB <- P[-sampleset, ] # takes the remaining rows...

Good question. The usual way is to use attributes and str in order to find such attributes in unknown classes (I guess this is how you found t0?), but this resulted in nothing for me. So I've decided to check the print method. A quick look at methods(print) Showed me...

r,matrix,resampling,statistics-bootstrap

Without using a package, you could do it like this: # your data set.seed(1234) x <- matrix( round(rnorm(200, 5)), ncol=10) # reset seed for this sampling exercise; define sample size and # iterations set.seed(1) samp_size <- 5 iter <- 15 # here are 15 blocks of 5 numbers, which will...

Given that the sign of an Eigenvector is not defined (you can flip the configuration and have the same result), it doesn't make sense to form a confidence interval on the the signed value of the loading. Instead compute the confidence interval on the absolute value of the loading, not...

The solution implies vectorizing the output of the hand-written function and, therefore, making it compatible with the boot procedure which requires results to be stored in a vector. est <- myfunction(y, x, z) good.output <- matrix(c(betax, s.z), ncol=1) This will let the boot function working properly. Then you just extract...