ssrm.logmer: Sample Size Determination for Longitudinal Designs with...

Description Usage Arguments Details Value References Examples

View source: R/ssrm.logmer.R

Description

Provides the necessary sample size for a longitudinal study with binary outcome in order to attain a pre-specified power while strictly maintaining the Type I error rate. The sample size computation requires the user to define a column of design matrix relating to the slope of time as a monotonic function of time, such as linear, log, sqrt etc., along with the respective beta parameters. The underlying model is assumed to be a two-level logistic mixed-effects regression model with random intercept and/or slope of time to account for within-subject correlations and between-subject variability. Gaussian quadrature is used to compute the marginal likelihood integrals and to evaluate Fisher Information matrix.

Usage

1
2
3
ssrm.logmer(nt = NULL, Xd = NULL, betap = NULL, var.ri = NULL,
  var.rs = NULL, cov.is = NULL, ratio = NULL, xi1 = NULL, xi2 = NULL,
  ...)

Arguments

nt

number of time-points.

Xd

design column for the slope of time (monotonic function of time).

betap

vector of beta parameters (b0=Intercept, b1=slope of time for control, b3=group difference at time 0 between treatment and control groups, b4=main parameter of interest which captures difference between the slope parameters of treatment and control groups).

var.ri

variance of random intercept.

var.rs

variance of random slope.

cov.is

covariance of intercept and slope.

ratio

proportion of subjects in the control group out of the total sample.

xi1

attrition vector of the control group. The elements of attrition vector should sum to 1.

xi2

attrition vector of the treatment group. The elements of attrition vector should sum to 1.

...

optional arguments alpha, power, tail, num.quad.

Details

Attrition vector: This package allows for the specification of different attrition vectors for the control and treatment group. The element of attrition vector should sum to 1.

Value

results

References

Kapur K, Bhaumik R, Charlene Tang X, Hur K, Reda DJ, Bhaumik DK (2014) <doi:10.1002/sim.6203>. Sample size determination for longitudinal designs with binary response. Stat Med 33(22):3781-3800.

Examples

1
2
3
4
ssrm.logmer(nt=4,Xd=c(0,1,2,3),betap=c(1,0,0.1,0.3),var.ri=0.5,
            ratio=0.5,xi1=c(0,0,0,1),xi2=c(0.1,0.1,0.2,0.6))
ssrm.logmer(nt=4,Xd=c(0,1,2,3),betap=c(1,0,0.1,0.3),var.ri=0.5,
            var.rs=0.25,cov.is=0.1,power=0.90,tail=1,alpha=0.025)

Example output

$Beta
[1] 1.0 0.0 0.1 0.3

$VarCovRE
     [,1] [,2]
[1,]  0.5    0
[2,]  0.0    0

$NumTime
[1] 4

$AttritionGrp1
[1] 0 0 0 1

$AttritionGrp2
[1] 0.1 0.1 0.2 0.6

$ColumnDesign
[1] 0 1 2 3

$Quadpoints
[1] 10

$alpha
[1] 0.05

$power
[1] 0.8

$tail
[1] 2

$Ratio
[1] 0.5

$N.group1
[1] 255

$N.group2
[1] 255

$Total.N
[1] 510

$Beta
[1] 1.0 0.0 0.1 0.3

$VarCovRE
     [,1] [,2]
[1,]  0.5 0.10
[2,]  0.1 0.25

$NumTime
[1] 4

$AttritionGrp1
[1] 0 0 0 1

$AttritionGrp2
[1] 0 0 0 1

$ColumnDesign
[1] 0 1 2 3

$Quadpoints
[1] 10

$alpha
[1] 0.025

$power
[1] 0.9

$tail
[1] 1

$Ratio
[1] 0.5

$N.group1
[1] 510

$N.group2
[1] 510

$Total.N
[1] 1020

ssrm.logmer documentation built on May 2, 2019, 2:44 p.m.