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

95% CI of R^2 in a linear mixed weighted regression

I am trying to calculate the R^2 and its 95%CI in linear mixed weighted regression. Since the summary of lme() doesn't provide R^2, I am using the r.squaredGLMM() from MuMIn package, and boot() from boot package. (If you have better way to do this,…
GZS
  • 47
  • 6
0
votes
0 answers

Different result of durbinWatsonTest

I know function durbinWatsonTest in package car use bootstrap method to calculate p-value, then the results are different when i rerun this code. Can someone know how to set seed this function? Many tks. df <- structure(list(y = c(-2.59, -3.42,…
0
votes
2 answers

How to write a bootstrapped mean difference using tidyverse?

I am interested in the difference in the mean of some variable according to a binary covariate. I am computing the confidence interval of this difference by bootstraping: library(tidyverse) df = mtcars %>% select(disp, vs) %>% …
Dan Chaltiel
  • 7,811
  • 5
  • 47
  • 92
0
votes
1 answer

Error in boot: unused argument (original), But argument IS being used

I am trying to boostrap a slope estimate using the boot function in the package boot . This is my function and boot code: library(boot) decay.rate <- function(data, treatment){ dt <- subset(data ,data$Treatment==treatment) …
0
votes
1 answer

How can I resample only a certain type of feature?

I want to resample from a data set so that I only resample positive cases since my data is very unbalanced. Here is my code: bootstrap=resample(Stroke['stroke']==1,replace=True,n_samples=800,random_state=1) All I get back is a True\False array.
0
votes
2 answers

trying to find the 95% confidence interval for a predicted value using bootstrap R

I have a linear model: fit <- lm(lifespan ~ log(Metabolic.by.mass), data = anage) I've predicted my y-value for an x-value of -6.10529 using this model which is determined to be 17.34775. Now I'm trying to create a 95% confidence interval for that…
0
votes
0 answers

Warnings using glmmboot and future package in R

I'm bootstrapping a glmmTMB using glmmboot package (version 0.5.1) in R. This useful package is implemented with the future package in order to parallelize processes. When I run the command it gives me this warning: UNRELIABLE VALUE: Future…
0
votes
1 answer

How to resample & create bootstrap by accounting for the hierarchical structure of data in R?

Consider the following data named as df: df <- data.frame(id1 = c(1,1,1,2,2,2,3,3,3,3,3,3), id2 = c('a','a','a','b','b','b','c','c','c','d','d','d'), y = c(3,5,8,5,8,5,1,4,5,4,4,7), x =…
0
votes
1 answer

bootstrap for different length of values

I would like to bootstrap my data to get a confidence intervals around a mean for a vector different lengths. For example with the code below I calculate y based on my vector x and then apply bootstrap to get CI. set.seed(001) x <-…
sler
  • 75
  • 6
0
votes
1 answer

How often a pair appear together over a large number of cluster solutions

In order to evaluate the stability of a classification/clustering solution I am running 1,000 bootstraps of the algorithm on my data. Over these classification outcomes I would like to count how often each pair occurs in the SAME cluster. I have…
Stephen Clark
  • 573
  • 3
  • 18
0
votes
1 answer

Logistics regression in R plotting Bootstrap using Titanic Dataset

I am working on an exercise for a statistics online course. I need to create a logistic regression in R using the titanic dataset. Therefore I want to apply the bootstrap method to create and plot 95% confidence intervals for the prediction of the…
0
votes
1 answer

How long should a Monte Carlo bootstrap power analysis simulation in R take? Is it potentially hours? (1000 reps, 1000 bootstraps)

I am using a Monte Carlo simulation to run a power analysis for a longitudinal mediation model. I'm using the power.boot function from the bmem package (lavaan). I checked the code with only 5 reps/5 bootstrap to make sure it worked and it did. Then…
0
votes
0 answers

"GET /static/bootstrap.min.css HTTP/1.1" 404 68

Im getting this error "GET /static/bootstrap.min.css.css HTTP/1.1" 404 68 in my terminal whenever I update my page with prod.py I build. I think it's my code in my settings.py that is wrong and with the static files also. there are my codes 1. B_F1 …
0
votes
1 answer

Create a simulated dataframe starting from a sample

I loaded a 10 rows sample, having around 10 columns. library(tidyverse) # A tibble: 7 x 9 case_id scenario alert_number random_ref_id amount code_type is_cred_debt source type
chopin_is_the_best
  • 1,951
  • 2
  • 23
  • 39
0
votes
1 answer

Calculate approximate trimmed 10% mean using percentile data

I have access to my services' latency metrics at all percentiles. I need to calculate the trimmed 10% mean of the service's latency now. Is there a way I can approximate the trimmed 10% mean using just the percentiles data? I understand I can simply…