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
0 answers

Bootstrapping residuals of a linear model

Suppose I want to assess the goodness of a linear model before and after leaving out a covariate, and I want to implement some kind of bootstrapping. I tried to bootstrap the sum of residuals of both models and then I applied the Kolmogorov-Smirnov…
0
votes
0 answers

How can you bypass a singular matrix error to continue to resample while in a loop/replicating?

I am running a two-part simulation based on a hurdle model. However, when bootstrapping and resampling, I am running into an error Error in solve.default(as.matrix(fit_zero$hessian)) : Lapack routine dgesv: system is exactly singular: U[1,1] =…
J Bacon
  • 27
  • 6
0
votes
0 answers

plotting bootstrapped confidence intervals

I am attempting to plot a bootstrapped linear model and I would like to include the models upper and lower confidence intervals and am not sure I am calculating the bootstrapped upper and lower bounds correctly. Below is an example using the cars…
Paul Julian
  • 245
  • 1
  • 2
  • 7
0
votes
0 answers

the data has 101 values why result has 303 values?

Data here is "sales" data with two columns price and sales and 16 rows for eg, price sales 49 81996 46 91735 50 70830 45 101192 51 78319 47 105369 47 68564 46 95523 49 88834 46 89511 45 107836 52 81410 50 …
0
votes
0 answers

How to calculate p-value comparing bootstrap-based predicted probabilities and observed probabilities

Given the sample data dat below, I would appreciate any help to: (1) check whether my approach below following boot's vignette to calculate bootstrap-based predictions from logistic regression is correct and help correct if there is any mistake in…
Krantz
  • 1,424
  • 1
  • 12
  • 31
0
votes
0 answers

How to bootstrap the result of arithmetic operation of regression coefficients of two models

I want to do bootstrap of the division of the outputs of two regression models to get confidence intervals of the mean of the result of the operation. #creating sample data ldose <- rep(0:5, 2) numdead <- c(1, 4, 9, 13, 18, 20, 0, 2, 6, 10, 12,…
Krantz
  • 1,424
  • 1
  • 12
  • 31
0
votes
1 answer

R: Bootstrap Multiple Regression

I am trying to run a multiple regression analysis to find the impact of water quality on plankton abundance in a specific location (aka Guzzler). I was able to get my model to run and the summary, however the data is non-parametric so a typical…
0
votes
1 answer

Select a sample at random and use it to generate 1000 bootstrap samples

I would like to generate 1000 samples of size 25 from a standard normal distribution, calculate the variance of each one, and create a histogram. I have the following: samples = replicate(1000, rnorm(25,0,1), simplify=FALSE) hist(sapply(samples,…
Jin Yu Li
  • 103
  • 3
  • 12
0
votes
2 answers

Program to reduce data set to meet specific values for multiple variables

I'm pretty desperate with this so any help would be really appreciated. I'm using R but have no problem using SAS as well if need be. I have a data set with around 100k entries, and 30 variables. I'd like to reduce this data set to 1k entries and…
0
votes
1 answer

How to do different types of bootstrap in r?

My bootstrap code in R gives an error and I can't see what is wrong with it. Does somebody see it? B <- 10000 bootstrap.results <- matrix(nrow=B,ncol=3) colnames(bootstrap.results) <- c("mu","sigma","convergence") for (b in 1:B){ sample.b <-…
0
votes
0 answers

popbio - Why isn't it reading my fertility column

I wanna do bootstrapping on my data using popbio's boot.transitions function. However, it is somehow giving a weird error with the fertility column: stagefate = read.table("file.csv", header = TRUE, sep=",") stagefatenames<- c("individual", "stage",…
Kaiser
  • 41
  • 1
  • 3
0
votes
1 answer

How to calculate 95% confidence intervals using bayesboot()

I need help to calculate bootstrap-based credible intervals of the quantity qtt.ci from my regression coef.def. So far my attempts have resulted in: Error in quantile.default(s, c(0.025, 0.25, 0.5, 0.75, 0.975)) : missing values and NaN's not…
0
votes
1 answer

SAS - defining variable as column sum and bootstrapping

I have a chunk to bootstrap a dataset. %let iter = 2; %let seed = 777; data work.seg; input segment $3. prem loss; datalines; AAA 5000 0 AAA 3000 12584 AAA 200 245 AAA 500 678 ; data work.test; do i=1 to &iter; sumprem=0; …
waealu
  • 331
  • 1
  • 9
0
votes
0 answers

In R, how to resample using cluster sampling with a defined number of clusters and observations within each cluster to prep for bootstrapping?

I have data for 100 households that were randomly sampled from a larger community. I would now like to resample 10,000 grabs of 20 households from the original 100 household sample using different cluster sampling methods (i.e. 10 clusters of 2…
RaBe
  • 51
  • 4
0
votes
1 answer

boot.ci() can't compute confidence intervals

I am trying compute confidence intervals for eta-squared for the Kruskal-Wallis test using the boot package in R. But it doesn't seem to work and I am not sure why. Getting the eta-squared (works!): Taking small steps, I start with a custom function…
Indrajeet Patil
  • 4,673
  • 2
  • 20
  • 51