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

R language, how to use bootstraps to generate maximum likelihood and AICc?

Sorry for a quite stupid question. I am doing multiple comparisons of morphologic traits through correlations of bootstraped data. I'm curious if such multiple comparisons are impacting my level of inference, as well as the effect of the potential…
perep1972
  • 147
  • 1
  • 9
0
votes
0 answers

How can I replicate a SAS sample from proc surveyselect with an R sample?

As an example, I created a dataset with 1 column numbered 1-10. I used the following SAS code: proc surveyselect data=sample out=sample2 method=urs n = 10 seed=1 outhits; run; This resulted in the following sample 5, 6, 7, 8, 9, 9, 9, 10, 10, 10.…
Mohini
  • 1
0
votes
1 answer

R is an unused argument in Boot, despite being there?

I am trying to compare different models using the same data. I am running R version 3.6.1 (which seems to have problems of its own— especially in downloading packages). This is what I am trying to do: bs <- function(formula=model1, data=my_data,…
0
votes
1 answer

Why optim() always gives me the same result?

I'm trying to use bootstrapping to calculate the confidence interval of MLE of parameter v. But in every iteration, optim() gives me the same result. Why is this happenning? Here's my code: # Create log-likelihood function dofloglik = function(v, x)…
dyluns
  • 155
  • 9
0
votes
2 answers

How do I use sample function for bootstrapping in R? Replacement row problem

I am trying to create a bootstrap for the data frame 'ev_all_clean' set.seed(1315) boot_s <- as.data.frame(matrix(NA, ncol = 19, nrow = 1000)) for(k in 1:19){ for(l in 1:1000){ boot_s[l,k]<- sample(ev_all_clean[,k], size=1, replace=T) } } The…
Vouz
  • 1
0
votes
1 answer

How to bootstrap R-squared of a mixed model?

I'm trying to obtain bootstrapped R^2 for a mixed effect model. As there is already only a workaround to obtain the conditional and marginal R^2, I tried to bootstrap these statistic based on an example given by statmethods for bootstrapping a…
Julian
  • 240
  • 1
  • 8
0
votes
0 answers

Bootstrap in R not correctly reproducing samples

I am trying to bootstrap in R but I can not figure out the right code. I have a set of 30 data points, either "yes" or "no". I was able to create 1000 bootstrap samples and retrieve the proportion of "yes" in each sample. Basically, if you convert…
0
votes
0 answers

bootMer output of lme4 linear mixed model: correct structure? at what level am I bootstrapping?

I have a linear mixed model that describes the relation between a continuous outcome and the interaction between a binary grouping variable (subjects are 1 out of 2 genotypes) and a time variable (5 consecutive days). Every subject has repeated…
RmyjuloR
  • 369
  • 1
  • 4
  • 13
0
votes
0 answers

Bootstrap Correlation in R. How to get bootstrapped r coefficient, p.value, Confidence Interval

I am trying to do a bootstrapped correlation in R. Following what I saw in these two posts: How can I get confidence intervals for a one-tailed, bootstrapped Pearson correlation in R? and Bootstrapped p-value for a correlation coefficient on R I…
Glu
  • 327
  • 3
  • 14
0
votes
0 answers

Large vector causing "Error in sample.int(n, n * R, replace = TRUE) : vector size cannot be NA" but how to fix?

The boot function doesn't seem to work for 66k resamples. The documentation doesn't seem to have any limits for the number of resamples and it works fine with a smaller number of resamples. Here's some sample…
happyspace
  • 113
  • 1
  • 2
  • 12
0
votes
1 answer

How to create a custom bootstrap function in R?

I want to create a custom bootstrap function. The reason for this are several. Better understanding (or let's just say understanding) of the process To extrapolate bootstrap resampling elsewhere without dependancy of packages I know there are some…
N00b
  • 27
  • 1
  • 6
0
votes
0 answers

How to leave Bootstrap external content on the right?

Documentation: https://getbootstrap.com/docs/4.3/components/navbar/#external-content Code:
0
votes
1 answer

How to perform bootstrapping to a diagnostic test in R?

I am analysing the accuracy of two diagnostics tests that detect if an individual has disease ("1") or no disease ("0") against a ground truth (gold standard). I want to calculate sensitivity, specificity and likelihood ratios with 95% Confidence…
olveraa
  • 35
  • 5
0
votes
1 answer

Random sampling from a data.table with different draws based on the categorical value in a column

I have a data table with different 20 sample IDs. Now I want to reduce the sample size randomly with a fixed distribution of IDs, meaning that I want to randomly draw lets say 7 values out of 'A' and 5 values out of 'B' so my data.table has 12 rows…
0
votes
0 answers

In R how to bootstrap a (joint) confidence region/ellipse for 2 or more parameters?

I am interested in how to create a (joint) confidence region (such as confidence ellipse) for a vector of parameters greater than 1. It is easy to bootstrap many replications of the bootstrapped statistic by just returning a vector of length greater…
Xu Wang
  • 10,199
  • 6
  • 44
  • 78