Questions tagged [statistics-bootstrap]

In statistics, a bootstrap is a resampling technique based on random sampling with replacement.

The bootstrap was introduced by Brad Efron in the Late 1970s. It is a computer‐intensive method that enables enables researchers to estimate the sample statistics (such as medians, variances, percentiles) by drawing randomly with replacement from a set of available data.

See also:

  1. The Wikipedia page on Bootstrapping
  2. Bootstrapping using boot package in R
  3. Brad Efron's paper on bootstrap
  4. Review on bootstrap methods in econometrics
602 questions
0
votes
1 answer

How to resample and remodel n times by vectorization?

here's my for loop version of doing resample and remodel, B <- 999 n <- nrow(butterfly) estMat <- matrix(NA, B+1, 2) estMat[B+1,] <- model$coef for (i in 1:B) { resample <- butterfly[sample(1:n, n, replace = TRUE),] re.model <- lm(Hk ~ inv.alt,…
0
votes
0 answers

Uniroot error when estimating coverage probability for an unspecified distribution

I am trying to compute the coverage probability for an unspecified distribution. I have copied my r codes below and the corresponding error message. Firstly, I defined the CDF as below. CD_theta <- function(x, p, n) { 1 - pbinom (x, size…
0
votes
1 answer

Getting Error Bootstrapping to test predictive model

rsq <- function(formula, Data1, indices) { d <- Data1[indices,] # allows boot to select sample fit <- lm(formula, Data1=d) return(summary(fit)$r.square) } results = boot(data = Data1, statistic = rsq, R = 500) When I execute the code, I get…
0
votes
2 answers

Sampling random rows of a dataframe in R with replacement

I want to be able to generate some confidence intervals for some test statistics using bootstrapping. What I would like to be able to do is to draw a bootstrapped dataset using sampling with replacement from my original dataset. I'm assuming that…
Kaitlin
  • 85
  • 2
  • 9
0
votes
1 answer

Confidence intervals via bootstrapping

Yesterday I began to read about using bootstrapping to determine confidence intervals (CIs) in many situations. My current situation is that I am trying to estimate three parameters in a model via maximum likelihood estimation (MLE). This I have…
Denver Dang
  • 2,433
  • 3
  • 38
  • 68
0
votes
0 answers

Bootstrapping a glmer model in R and associated errors

I have the following glmer model which I have run in lme4, in R: m1=glmer(Survived~Offset+(1|Trial/Chamber), family=binomial, data=surviveData) Survived is a binary response, Offset is a three level factor, Trial is a 2 level factor and Chamber…
JeanDrayton
  • 131
  • 2
0
votes
1 answer

Create a matrix from a list consisting of unequal matrices for individual bootstraps

I tried to create a matrix from a list which consists of N unequal matrices... The reason to do this is to make R individual bootstrap samples. In the example below you can find e.g. 2 companies, where we have 1 with 10 & 1 with just 5…
0
votes
1 answer

R - Error in if (order[7] > 1 & sum(order[4:6]) > 0) result <- paste(result, : argument is of length zero

I'm trying to do a bootstrapping process with a Renshaw and Haberman model fit with STMoMo package. Here is the code : RHboot<- bootstrap(RHfit, nBoot = 2000, type = "semiparametric") plot(RHboot,nCol = 3,parametricbx=FALSE) RHSimPU <-…
0
votes
1 answer

Bootstrap correlation matlab

I want to correlate two arrays (A and B) from a medical image. I expect a high correlation since they come from the same patient (acquired twice in the same session). [rho, p] = corr(A(:), B(:)) gives me rho = 0.8321 but p = 0.1255 so the…
Inchan
  • 1
  • 3
0
votes
1 answer

does boot package in r, use the first return(result) as the observed data to calculate confidence intervals

I am using the function boot in R to do a bootstrap, but instead of passing my dataset directly as the data parameter in the boot function, I pass an index that is used inside the statistic to merge two data tables to get my result. It seems that…
Herman Toothrot
  • 1,463
  • 3
  • 23
  • 53
0
votes
2 answers

get means across samples from bootstrap

I want to get the means and sds across 20 sampled data, but not sure how to do that. My current code can give me the means within each sample, not across samples. ## create data data <- round(rnorm(100, 5, 3)) data[1:10] ## obtain 20 boostrap…
mandy
  • 483
  • 9
  • 20
0
votes
1 answer

Resampling on non-NA in matrix

How can we resample only on the non-NA elements and get another matrix 10x10 with NA in lower ? mymatrix [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] -0.6068580 -0.8890714…
John john
  • 437
  • 3
  • 13
0
votes
1 answer

bootstrap-4.0-dist gives error message,match jdk1.6 with myeclipse 10

I put the bootstrap-4.0-dist folder to the new web project folder of webroot,then I run the server and the console appear some errors and the bootstrap.bundle.js appeaared a big red "X",I copy the error message. bootstrap.bundle.js error message 1 …
L. Linda
  • 1
  • 3
0
votes
1 answer

Robust 3 way ANOVA in R

I'm trying to conduct a 3 way Anova in R, using the WRS2 package. My data is heteroskedastic so i need to do a robust version e.g. trimmed means. I have my data arranged in long form (csv with 4 columns - 3 factors and 1 numeral). My input looks…
0
votes
1 answer

Bootstrapping eigenvalues for nonlinear PCA in r

I am running nonlinear PCA in r, using the homals package. Here is a chunk of the code I am using as an example: res1 <- homals(data = mydata, rank = 1, ndim = 9, level = "nominal") res1 <- rescale(res1) I want to generate 1000 bootstrap estimates…
Eszter
  • 3
  • 2