table.H2x2Factorial {H2x2Factorial} | R Documentation |
H2x2Factorial Table
Description
The function table.H2x2Factorial
outputs a data frame that summarizes the required number of clusters and the predicted
power based on a constellation of design parameters. This function is useful when the user wants a series of table-format predictions
based on varying design parameters including mean cluster size (m_bar), intraclass correlation coefficient (rho), and coefficient of variation of the cluster sizes (CV).
Usage
table.H2x2Factorial(power=0.8, alpha=0.05,
pi_x=0.5, pi_z=0.5,
delta_x, delta_z, delta_xz, sigma2_y=1,
m_bar, CV, rho,
estimand="controlled", test="cluster", correction=FALSE,
max_n=1e8, seed_mix=NULL, size_mix=1e4,
verbose=TRUE)
Arguments
power |
a numeric value between 0 and 1 as the desired power level for sample size estimation. Default is |
alpha |
a numeric value between 0 and 1 as the type I error rate. Default is |
pi_x |
a numeric value between 0 and 1 as the proportion of clusters randomized to the cluster-level treatment. Default is |
pi_z |
a numeric value between 0 and 1 as the proportion of individuals randomized to the individual-level treatment within each cluster. Default is |
delta_x |
a nonzero numeric value for the (unstandardized) effect size of the marginal cluster-level treatment effect. Default is |
delta_z |
a nonzero numeric value for the (unstandardized) effect size of the marginal individual-level treatment effect. Default is |
delta_xz |
a nonzero numeric value for the (unstandardized) effect size of the interaction effect of the two treatments. Default is |
sigma2_y |
a positive numeric value for the total variance of the continuous outcome. Default is |
m_bar |
a vector of numeric values larger than 2 for a series of mean cluster sizes. |
CV |
a vector of positive numeric values for a series of coefficients of variation of the cluster sizes. |
rho |
a vector of numeric values between 0 and 1 for a series of intraclass correlation coefficients. |
estimand |
a character argument indicating the type of treatment effect estimand. Supported values include |
test |
a character argument indicating the type of hypothesis test of interest. Supported values include
|
correction |
a logical argument indicating whether a finite sample correction should be used. Default is |
max_n |
an optional setting of a maximum number of clusters, which is only functional under |
seed_mix |
an optional setting of a seed for conducting the simulation-based testing under a mixed distribution, which is only functional under |
size_mix |
a pre-specified size for the mixed distribution in the simulation-based procedure, which is only needed under |
verbose |
a logical argument indicating whether the parameter reiterations and supplementary messages should be presented or suppressed. Default is |
Details
If the user further requires a vector of power
or other parameters like pi_x
, which invokes the need for multiple tables,
an external loop could be easily written using this function to produce multiple data frames.
Value
table.H2x2Factorial
returns a data frame with inputs of m_bar
, rho
, and CV
varied in a factorial setting, the predicted number of clusters n
under the power requirement,
and the actual power predicted.power
the estimated sample size can help to achieve, with some suppressible messages.
Examples
#Make a result table by providing three mean cluster sizes, three CV, and three ICC
table.cluster <- table.H2x2Factorial(delta_x=0.2, delta_z=0.1,
m_bar=c(10,50,100), CV=c(0, 0.3, 0.5), rho=c(0.01, 0.1),
estimand="controlled", test="cluster", verbose=FALSE)
table.cluster