check_sims: Assess model performance

Description Usage Arguments Value See Also Examples

View source: R/assess_performance.R

Description

Calculates several measures of model performance, based on results of fitting a model to all simulated datasets.

Usage

1
check_sims(df, true_rr)

Arguments

df

A data frame of replicated simulations which must include a column titled "Estimate" with the effect estimate from the fitted model.

true_rr

The true relative risk used to simulate the data.

Value

A dataframe with one row with model assessment across all simulations. Includes values for:

See Also

The following functions are used to calculate these measurements: beta_bias, beta_var, coverage_beta, mean_beta, power_beta

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
sims <- create_sims(n_reps = 100, n = 1000, central = 100,
                    sd = 10, exposure_type = "continuous",
                    exposure_trend = "cos1",
                    exposure_amp = 0.6,
                    average_outcome = 20,
                    outcome_trend = "no trend",
                    rr = 1.02)
fits <- fit_mods(data = sims, custom_model = spline_mod,
                 custom_model_args = list(df_year = 1))
check_sims(df = fits, true_rr = 1.02)

eesim documentation built on June 4, 2017, 1:03 a.m.