Learn R Programming

eesim (version 0.1.0)

beta_var: Standard Deviation of Estimated Coefficients

Description

Measures the variance of the point estimates of the estimated log relative risk (\(\hat{beta}\)) over the n_rep simulations and the mean of the variances of each \(\hat{\beta}\).

Usage

beta_var(df)

Arguments

df

A data frame of replicated simulations which must include columns titled "Estimate" and "Std.Error".

Value

A data frame of the variance across all values of beta hat and the mean variance of the beta hats

Examples

Run this code
sims <- create_sims(n_reps = 10, n = 600, central = 100,
                    sd = 10, exposure_type = "continuous",
                    exposure_trend = "cos1",
                    exposure_amp = 0.6,
                    average_outcome = 20,
                    outcome_trend = "no trend",
                    rr = 1.01)
fits <- fit_mods(data = sims, custom_model = spline_mod,
                 custom_model_args  = list(df_year = 1))
beta_var(fits)

Run the code above in your browser using DataLab