Description Usage Arguments Value See Also Examples
View source: R/assess_performance.R
Calculates several measures of model performance, based on results of fitting a model to all simulated datasets.
1 | check_sims(df, true_rr)
|
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. |
A dataframe with one row with model assessment across all simulations. Includes values for:
beta_hat
: Mean of the estimated log relative risk across all simulations.
rr_hat
: Mean value of the estimated relative risk across all simulations.
var_across_betas
: Variance of the estimated log relative risk across all
simulations
mean_beta_var
: The mean of the estimated variances of the estimated log
relative risks across all simulations.
percent_bias
: The relative bias of the estimated log relative risks compared
to the true log relative risk.
coverage
: Percent of simulations for which the estimated 95% confidence
interval for log relative risk includes the true log relative risk.
power
: Percent of simulations for which the null hypothesis that the log
relative risk equals zero is rejected based on a p-value of 0.05.
The following functions are used to calculate these measurements:
beta_bias
, beta_var
, coverage_beta
,
mean_beta
, power_beta
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.