View source: R/q.samp.size.t.R
q.samp.size.t | R Documentation |
Calculate sample size for a difference in mean based on pwr.t.test from the pwr package
q.samp.size.t(refmean=NULL, compmean=NULL, SD=NULL, dropout=0.2, arms=2, sig.level = 0.05 , power = 0.8, type = "two.sample", alternative ="two.sided")
refmean |
Mean for the product/intervention of interest |
compmean |
Mean for comparator/placebo |
SD |
Pooled standard deviation for calculation of Cohen's d |
dropout |
Dropout rate to be accounted for in sample size calculation. Default is 0.2 |
arms |
Number of armes in the planned study |
sig.level |
Significance level. Default is 0.05 |
power |
Power. Default is 0.8 |
type |
A character string specifying the type of test. Options: "one.sample", "two.sample" (default) or "paired" (see pwr.t.test) |
alternative |
A charater string specifying the alternative hypothesis. Options: "two.sided" (default), "greater" or "less" (see pwr.t.test) |
A list containing the mean difference, mean ratio, number of completers per arm, total sample size per arm, total sample size for the study and number of study arms
Abdul Malik Sulley <asulley@uwo.ca> 22 April, 2020
pwr.t.test
sds <- c(21.1, 32.2, 43.3) ns <- c(40, 37, 39) SD <- q.pooled_sd(sds, ns) refmean <- 57.2 compmean <- 22.8 q.samp.size.t(refmean, compmean, SD, dropout=0.2, type = "two.sample", alternative ="two.sided", arms=2 )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.