Description Usage Arguments Value Examples
Enter first level estimates and second level estimates, get bootstrap interval, from the pivotal bootstrap t (Efron and Tibshirani 1994, also endorsed by Hesterberg 2015).
1 2 3 4 5 6 7 | bootstrap_ci(
base_coef_se = NULL,
resampled_coef_se = NULL,
orig_df = NULL,
alpha_level = 0.05,
probs = NULL
)
|
base_coef_se |
Estimates and SEs from full sample. In matrix form,
i.e. a (p+1) x 2 matrix, first column is estimates,
second is standard errors. This is the output from using:
|
resampled_coef_se |
List of estimates and SEs from the bootstrapped resamples, each list entry has the same format as the base_coef_se above. |
orig_df |
Degrees of freedom to use to calculate the t-values used for the base interval. |
alpha_level |
level of CI - if you fill in |
probs |
Default |
A matrix containing:
Estimates
Bootstrap interval endpoints
Bootstrap p-value
Base p-value
Base interval endpoints
Relative width of bootstrap interval to base
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | x <- rnorm(20)
y <- rnorm(20) + x
xy_data = data.frame(x = x, y = y)
first_model <- lm(y ~ x, data = xy_data)
out_list <- bootstrap_model(first_model, base_data = xy_data, 20,
return_coefs_instead = TRUE)
bootstrap_ci(out_list$base_coef_se,
out_list$resampled_coef_se)
data(test_data)
library(glmmTMB)
## where subj is a random effect
test_model <- glmmTMB(y ~ x_var1 + (1 | subj),
data = test_data, family = binomial)
output_lists <- bootstrap_model(test_model, base_data = test_data, 199,
return_coefs_instead = TRUE)
bootstrap_ci(output_lists$base_coef_se,
output_lists$resampled_coef_se)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.