Skip to content

compute_summary_statistics_of_simulations

Description

Wrapper for calling compute_dataset_simulation nruns time and computing summary statsitics of the simulations

Usage

compute_summary_statistics_of_simulations(
data,
fit,
xdata_col,
conf_int,
nruns,
nbins,
type = 2
)

Arguments

NameDescription
dataa dataframe conatining QTc dataset
fitan lme fit model
xdata_colan unqoted column name for xdata
conf_inta fractional numeric for confidence interval (quantiles of 5/95th quantiles), default = 0.9
nrunsinteger number of simulations to run
nbinsinteger number of bins to break independent variable into - OR - a user specified vector for non-uniform binning
typealgorithm for quantile. Default (2), is SAS quantile algorithm

Returns

a tibble of summary statistics of nruns worth of dataset simulations for a VPC.

Examples

data_proc <- preprocess(data)
fit <- nlme::lme(
fixed = deltaQTCF ~ 1 + CONC,
random = ~ 1 | ID,
data = data_proc,
method = "REML",
na.action = "na.exclude"
)
compute_summary_statistics_of_simulations(
data = data_proc,
fit = fit,
xdata_col = CONC,
conf_int = 0.9,
nruns = 50,
nbins = 10,
type = 2)
compute_summary_statistics_of_simulations.R
# A tibble: 250 × 15
decile sim_num med_xdata med_pred low_pred high_pred mean_med_pred
<fct> <int> <dbl> <dbl> <dbl> <dbl> <dbl>
1 [0,9.05] 1 0 -6.82 -20.0 6.62 -6.98
2 [0,9.05] 2 0 -7.18 -20.5 4.20 -6.98
3 [0,9.05] 3 0 -5.95 -20.4 6.48 -6.98
4 [0,9.05] 4 0 -6.75 -20.1 3.58 -6.98
5 [0,9.05] 5 0 -7.63 -18.5 6.32 -6.98
6 [0,9.05] 6 0 -7.61 -19.3 7.05 -6.98
7 [0,9.05] 7 0 -7.21 -18.2 6.53 -6.98
8 [0,9.05] 8 0 -7.55 -20.3 5.80 -6.98
9 [0,9.05] 9 0 -6.67 -18.1 6.44 -6.98
10 [0,9.05] 10 0 -7.49 -19.0 6.06 -6.98
# ℹ 240 more rows
# ℹ 8 more variables: low_med_pred <dbl>, high_med_pred <dbl>,
# mean_low_pred <dbl>, low_low_pred <dbl>, high_low_pred <dbl>,
# mean_high_pred <dbl>, low_high_pred <dbl>, high_high_pred <dbl>