Learn R Programming

gsearly (version 1.0.0)

expectSampsize: Expected sample size for a gsearly model

Description

Calculates the expected sample size for a fitted gsearly model, from functions gsearlyModel or gsearlyUser.

Usage

expectSampsize(mod, signif=3)

Value

Returns the sample size for the control and treatment groups and total.

Arguments

mod

A gsearly model.

signif

Rounds the sample size to the specified number of significant digits.

See Also

gsearlyModel, gsearlyUser

Examples

Run this code

 # For 90 percent power (pow), a call to gsearlyModel provides a feasible design
 fp <- c(0.0010,0.0100,0.0250)
 tn <- c(0.4800,0.7200,0.9750)
 rctdesign <- gsearlyModel(rmodel="fix", trecruit=36, s=3, tfu=c(3,6,12),
                   tinterims=c(16,31), pow=0.8, cmodel="exponential", sd=20,
                   rho=0.75, theta=8, fp=fp, tn=tn)
 expectSampsize(rctdesign)

Run the code above in your browser using DataLab