Learn R Programming

cg (version 1.0-0)

samplesizeTable: Estimate Required Sample Sizes

Description

Estimate the sample size required to detect a specified difference in a future study. The estimate is based on the variability in a data fit with the cg package.

Usage

samplesizeTable(fit, direction, mmdvec, power = 0.80,
 alpha = 0.05, nmax = 1000, display = "print", ...)

Arguments

fit
An object created by calling a fit method from the cg package. There is currently one class of objects that are currently available: cgO
direction
A character indicating whether the sample size should be estimated to detect an "increase" or a "decrease". This only effects the sample size estimates if the previous study in fit was a
mmdvec
A numeric vector specifying the minimum meaningful differences to be detected in the future study. If the previous study in fit was analyzed on the log scale, then the values in mmdvec ar
power
The power for the future study, set by default to be 0.80. This is equivalent to $1 - \beta$, where $\beta$ is the probability of committing a Type II error: accepting the null hypothesis of no difference when differences
alpha
The significance level or alpha for the future study, set by default as 0.05.
nmax
The maximum number of subjects per group. If more subjects are estimated to be required, than the exact number required is not reported, only the fact that more than the maximum number would be required. This is in place to prevent long an
display
One of three valid values: [object Object],[object Object],[object Object]
...
Additional arguments, depending on the specific method written for the object. See the method-specific documentation for additional details.

Value

  • A method-specific SampleSizeTable object is returned. See the specific methods for discussion of return values.

concept

sample size

See Also

samplesizeTable.cgOneFactorFit

Examples

Run this code
#### One Factor data

data(canine)
canine.data <- prepareCGOneFactorData(canine, format="groupcolumns",
                                      analysisname="Canine",
                                      endptname="Prostate Volume",
                                      endptunits=expression(plain(cm)^3),
                                      digits=1, logscale=TRUE, refgrp="CC")
canine.fit <- fit(canine.data)

canine.samplesize <- samplesizeTable(canine.fit, direction="increasing", 
                                     mmdvec=c(10, 25, 50, 75, 100))

samplesizeGraph(canine.samplesize)

Run the code above in your browser using DataLab