PostHocPwr | R Documentation |
PostHocPwr
allows for the post hoc power analysis of the synergy hypothesis testing for Bliss and HSA refence
models for a given tumor growth data fitted model.
PostHocPwr(model, nsim = 1000, method = "Bliss", pvalue = 0.05, time = NA, ...)
model |
An object of class "lme" representing the linear mixed-effects model fitted by |
nsim |
Number of simulations to perform. |
method |
String indicating the method for synergy calculation. Possible methods are "Bliss" and "HSA", corresponding to Bliss and highest single agent, respectively. |
pvalue |
Threshold for the p-value of synergy calculation to be considered statistically significant. |
time |
Time point for which to calculate the statistical power. If not specified, the last time point is used by default. |
... |
Additional parameters to be passed to nlmeU::simulateY: |
The post hoc power calculation relies on simulation of the dependent variable, using nlmeU::simulateY.
For a given fitted model of the tumor growth data, nsim
simulations of the dependent variable (\log (RTV)
)
are done, based on the marginal distribution implied by the fitted model.
The model is then fitted to the new values of the dependant variable.
For each simulation, the new estimates from each model are then used for the synergy hypothesis testing as explained in lmmSynergy, and the p-values stored.
The power is returned as the proportion of simulations resulting in a significant synergy hypothesis testing
(p-value < pvalue
).
When time
is specified, PostHocPwr
refits the model using the data from the time_start
time point defined in lmmModel()
until time
, and report the
statistical power for that model. If time
is not specified, the model fitted using all data points is used for statistical power calculation.
Returns a numeric value of the power for the synergy calculation for the model using the method specified in method
.
The power is expressed as the proportion of simulations that provides a p-value below the threshold specified in pvalue
.
Andrzej Galecki & Tomasz Burzykowski (2013) Linear Mixed-Effects Models Using R: A Step-by-Step Approach First Edition. Springer, New York. ISBN 978-1-4614-3899-1
APrioriPwr()
, PwrSampleSize()
, PwrTime()
.
#' data(grwth_data)
# Fit the model
lmm <- lmmModel(
data = grwth_data,
sample_id = "subject",
time = "Time",
treatment = "Treatment",
tumor_vol = "TumorVolume",
trt_control = "Control",
drug_a = "DrugA",
drug_b = "DrugB",
combination = "Combination"
)
PostHocPwr(lmm, nsim = 50) # 50 simulations for shorter computing time
# Using a seed to obtain reproducible results
PostHocPwr(lmm, seed = 123, nsim = 50)
# Calculating the power for an specific day
PostHocPwr(lmm, nsim = 50, time = 6)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.