PowFrailtyDat {PDXpower} | R Documentation |
A function to obtain a power table with the combination of various number of PDX lines and number of individuals per PDX lines per treatment based on a preliminary dataset
PowFrailtyDat(
data = NULL,
formula = NULL,
maxit = 50,
hazard = "Weibull",
n = NULL,
m = NULL,
sim = 1000,
censor = FALSE,
Ct = 5,
two.sided = TRUE,
alpha = 0.05,
fixed.effect = FALSE,
digits = 4,
ncores = NULL
)
data |
data.frame in which to interpret the variables named in the formula. |
formula |
a formula object, with the response on the left of a ~ operator, and the terms on the right. The response must be a survival object as returned by the Surv function. |
maxit |
maximum number of iterations needed for model fitting. Default is 50. |
hazard |
distributional assumption of the baseline hazard. Default is Weibull. |
n |
an integer number to specify the number of PDX lines. |
m |
an integer number to specify the number of individuals per PDX line per treatment. |
sim |
Number of Monte Carlo samples to be generated. Default is 1000. |
censor |
logical value of whether a censoring distribution is considered in a data generation setting. Default is FALSE. |
Ct |
a fixed time point when a study is designed to end for generating type 1 censoring data. |
two.sided |
A logical value to indicate if a two-sided hypothesis testing is conducted. Default is TRUE. |
alpha |
significance level. Default is 0.05. |
fixed.effect |
logical value to indicate if a fixed effects only model is fitted. Default is FALSE. |
digits |
digits the number of significant digits to use when printing. |
ncores |
number of cores for parallel computation. |
Object of PowFrailtyDat
with elements
lambda |
the estimated scale parameter of Weibull baseline hazard from the pilot data. |
nu |
the estimated shape parameter of Weibull baseline hazard from the pilot data. |
beta |
the estimated treatment effect from the pilot data. |
tau2 |
the estimated inter-PDX variance from the pilot data. |
sigma2 |
the estimated random error variance from the pilot data. |
PowTab |
the estimates of statistical power across |
require(PDXpower)
data(animals2)
PowTab <- PowFrailtyDat(data = animals2, formula = Surv(Y,status) ~ Tx + cluster(ID),
n = 3, m = 2, ncores = 1)
PowTab
plotpower(PowTab[[5]], ylim = c(0, 1))