PostHocPwr: Post hoc power calculation based on simulations of the...

View source: R/PostHocPwr.R

PostHocPwrR Documentation

Post hoc power calculation based on simulations of the synergy evaluation using LMM.

Description

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.

Usage

PostHocPwr(model, nsim = 1000, method = "Bliss", pvalue = 0.05, time = NA, ...)

Arguments

model

An object of class "lme" representing the linear mixed-effects model fitted by lmmModel().

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:

Details

The post hoc power calculation relies on simulation of the dependent variable, using nlmeU::simulateY.

  1. 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.

  2. The model is then fitted to the new values of the dependant variable.

  3. 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.

  4. 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.

Value

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.

References

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

See Also

APrioriPwr(), PwrSampleSize(), PwrTime().

Examples

#' 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)


SynergyLMM documentation built on April 4, 2025, 4:13 a.m.