Calsamplesize {RCT2} | R Documentation |
Sample size calculations for detecting a specific alternative
Description
This function calculates the sample size needed to detect a specific alternative hypothesis with a given power at a given significance level. For the details of the method implemented by this function, see the references.
Usage
Calsamplesize(data, mu, qa, alpha = 0.05, beta = 0.2)
Arguments
data |
A data frame containing the relevant variables. The names for the variables should be “Z” for the treatment assignment, “Y” for the treatment outcome, “A” for the treatment assignment mechanism, and “id” for the cluster ID. The variable for the cluster ID should be a factor. |
mu |
The effect size (i.e. the largest direct effect across treatment assignment mechanisms). |
qa |
The proportions of different treatment assignment mechanisms. |
alpha |
The given significance level (default 0.05). |
beta |
The given power level (default 0.2). |
Value
A list of class sampleSRE
which contains the following item:
samplesize |
A list of the calculated necessary nubmer of clusters for each assignment mechanism in order to detect a specific alternative with a given power at a given significance level. |
Author(s)
Kosuke Imai, Department of Statistics, Harvard University imai@harvard.edu, https://imai.fas.harvard.edu/; Zhichao Jiang, School of Public Health and Health Sciences, University of Massachusetts Amherst zhichaojiang@umass.edu; Karissa Huang, Department of Statistics, Harvard College krhuang@college.harvard.edu
References
Zhichao Jiang, Kosuke Imai (2020). “Statistical Inference and Power Analysis for Direct and Spillover Effects in Two-Stage Randomized Experiments”, Technical Report.