Learn R Programming

gsearly (version 1.0.0)

fixedSampsize: Fixed model sample size for a gsearly model

Description

Calculates the fixed model sample size, assuming no correlation between early and final outcomes, for a fitted gsearly model, from functions gsearlyModel or gsearlyUser.

Usage

fixedSampsize(mod, pow=NULL, direct="u", signif=3)

Value

Returns a list with the following items.

n

Sample size for the control and treatment groups and total.

power

Study power.

Arguments

mod

A gsearly model.

pow

Power is set to a value between 0 and 1, or if unset is taken from mod.

direct

Rounds sample sizes to nearest integer, upwards "u" (using ceiling) or downwards "d" (using floor)

signif

Rounds power 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.0000,0.0010,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)
 fixedSampsize(rctdesign)

Run the code above in your browser using DataLab