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
Name | Description |
---|---|
data | a dataframe conatining QTc dataset |
fit | an lme fit model |
xdata_col | an unqoted column name for xdata |
conf_int | a fractional numeric for confidence interval (quantiles of 5/95th quantiles), default = 0.9 |
nruns | integer number of simulations to run |
nbins | integer number of bins to break independent variable into - OR - a user specified vector for non-uniform binning |
type | algorithm 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)
# 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.11 -18.3 6.62 -6.97 2 [0,9.05] 2 0 -7.42 -19.5 6.45 -6.97 3 [0,9.05] 3 0 -6.33 -19.4 6.40 -6.97 4 [0,9.05] 4 0 -5.61 -18.0 5.82 -6.97 5 [0,9.05] 5 0 -6.58 -19.1 7.07 -6.97 6 [0,9.05] 6 0 -6.75 -18.4 5.71 -6.97 7 [0,9.05] 7 0 -7.43 -20.1 3.64 -6.97 8 [0,9.05] 8 0 -6.79 -17.4 5.72 -6.97 9 [0,9.05] 9 0 -6.77 -18.5 6.67 -6.9710 [0,9.05] 10 0 -7.01 -19.3 6.06 -6.97# ℹ 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>