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

Create a block of a sequence of numbers - R

I would like to create a block, meaning an immutable list of numbers, of a sequence of numbers in R. Meaning that when I index the list, I will get the group of numbers. ts <- cbind(1:11, 12:22, 23:33, 34:44, 45:55, 56:66, 67:77, 78:88, 89:99,…
0
votes
1 answer

Random matrix with diagonal entries 0's and all other entries are 0's and 1's

I tried using the rbern function in R but I realized that the diagonal entries are not all 0's.
0
votes
2 answers

R error message in my bootstrapping & regression code

I wanted to use bootstrapping & run a regression, but for some reason, it doesn't work. I always get the error message "Anzahl der zu ersetzenden Elemente ist kein Vielfaches der Ersetzungslänge" (in English: apparently I have two sets of elements &…
Merle
  • 125
  • 1
  • 14
0
votes
2 answers

A Problem with Family-wise Error Calculation

Consider I have a data set with a 12 variable and it contains about 100 cases. If I am going to do a t-test between two variables, then doing an ANOVA between 3 other variables then a post-hoc. and maybe after that a Mann-Whitney for non-parametric…
0
votes
2 answers

Is it possible to generate a sample of 10 from a population and repeat that sampling 1000 times?

I am trying to randomly sample 10 individuals from a population and repeat 1000 times. Is this possible? Here is my code so far and I am not quite sure if I am on the right track. I keep receiving the error "number of items to replace is not a…
Sarah
  • 43
  • 4
0
votes
1 answer

Bootstrap with Stepwise Regression in R

I am trying to take bootstrap samples and conduct stepwise regression in R. I am trying to look at the distribution of the regression coefficients, but the "bhat" matrix I am working on is mostly printing out NAs with the exception of the first row…
user13301376
0
votes
1 answer

Bootstrapping "lme()", nlme, by lmeresampler

Does anyone know how to bootstrap a linear mixed-effect model constructed by lme function (nlme package)? Half year ago I was able to do that by "bootstrap" function from "lmeresampler" package, but it doesn't currently run with the same data and…
Mmm
  • 11
  • 1
0
votes
2 answers

Problems with accessing double elements in a list in R

I have performed a bootstrapping with 2.000 resamples of the Lee Carter model for mortality projection. The question is not specific for mortality studies, but on more general dimensions in R. After performing the bootstrapping I get a list with…
0
votes
0 answers

bootstrapping for proportion.test power analysis

I adapted the following code from here. I am trying to simulate power for a proportion test. I keep getting the following error message: Error in prop.test(treat, ctrl) : 'x' and 'n' must have the same length I don't quite understand why, since I…
0
votes
1 answer

Bootstrapping in R: Predict

I am running a program where I conduct an OLS regression and then I subtract the coefficients from the actual observations to keep the residuals. model1 = lm(data = final, obs ~ day + poly(temp,2) + prpn + school + lag1) # linear model predfit =…
Santi
  • 1
  • 1
0
votes
1 answer

How to bootstrap with lapply? bootstrap error with boot() in R

I am getting an error "Error in statistic(data, original, ...) : unused argument (original)" when trying to execute the code below. Specifically, I am trying to apply a function and bootstrap those results for each plot#. Am I missing something…
ecology
  • 606
  • 3
  • 9
  • 29
0
votes
0 answers

"'newdata' had 20 rows but variables found have 90 rows"

hw4<-read.csv("***") x<-hw4[,1] #length of x is…
0
votes
1 answer

Why does the distribution of p-values peak at around zero when running a 1000x bootstrapped t-test on my data?

I have some numerical measurements on two groups of people and I would like to compare means between these two groups. Just using a t-test for that purpose which gives me a confidence interval and p-value. Now, I'd like do a bootstrap analysis on…
Ralph
  • 151
  • 11
0
votes
3 answers

In R with clustered data, how would you bootstrap at the cluster level and keep the same observation when clusters are chosen repeatedly?

I am trying to bootstrap sample in R from a longitudinal dataset with multiple observations per person (i.e. data collected in multiple waves over time). So the data look like this: id wave variable 101 1 15 101 2 17 101 3 …
0
votes
1 answer

How to use tryCatch() during bootstrapping with modelr/tidyverse?

This question is similar to Using tryCatch() to catch a bootstrap loop, but I'm having trouble applying the suggestions to my case using the tidyverse method of bootstrapping. I am trying to obtain confidence interval estimates for coefficients from…