run_sim_rstar_glm {holi} | R Documentation |
Run Multiple Iterations of Simulation and Summarize Results
Description
This function runs multiple iterations of simulation for the sim_rstar_glm
function and summarizes the results, including rejection rates, bias, empirical
standard error, mean squared error, and root mean squared error.
Usage
run_sim_rstar_glm(
n_sims,
alpha_level = 0.05,
n_main,
n_covariates,
true_coef_main,
n_control = NULL,
true_coef_control = NULL,
treatment_effect = NULL,
model = c("logistic", "linear", "poisson"),
skewness_main = NULL,
skewness_control = NULL,
Sigma_main = NULL,
Sigma_control = NULL,
...
)
Arguments
n_sims |
Number of simulations to run. |
alpha_level |
Significance level for hypothesis tests. |
n_main |
Number of observations in the main group. |
n_covariates |
Number of covariates. |
true_coef_main |
True coefficients for the main group. |
n_control |
Number of observations in the control group. |
true_coef_control |
True coefficients for the control group. |
treatment_effect |
Treatment effect size. |
model |
Type of model: "logistic", "linear", or "poisson". |
skewness_main |
Skewness for the main group covariates. |
skewness_control |
Skewness for the control group covariates. |
Sigma_main |
Covariance matrix for the main group covariates. |
Sigma_control |
Covariance matrix for the control group covariates. |
... |
Additional arguments passed to |
Value
A list with the results of each simulation and a summary of the results.
References
Pierce, D. A., & Bellio, R. (2017). Modern Likelihood-Frequentist Inference. International Statistical Review / Revue Internationale de Statistique, 85(3), 519–541. doi:10.1111/insr.12232
Bellio R, Pierce D (2020). likelihoodAsy: Functions for Likelihood Asymptotics. R package version 0.51, https://CRAN.R-project.org/package=likelihoodAsy.
Examples
sim_summary <- run_sim_rstar_glm(
n_sims = 2, alpha_level = 0.05,
n_main = 100, n_covariates = 2, true_coef_main = c(0.5, -0.3),
n_control = 100, true_coef_control = c(0.2, -0.1),
treatment_effect = 1, model = "linear"
) |> suppressWarnings()