simStudy: Performs a simulation study

View source: R/simStudy.R

simStudyR Documentation

Performs a simulation study

Description

Performs a simulation study comparing bias and coverage probability when using either GEE or a semiparametric approach in analyzing accelerometer data

Usage

simStudy(n,numsim,beta,nu,mu,inf,nobs)

Arguments

n

Number of individuals in a simulated data.

numsim

Number of simulated datesets.

beta

True coefficient for the binary covariate.

nu

Shape and rate parameter for Gamma distribution, in which the subject specific random variable Z_i was generated.

mu

Baseline mean minutes of physical activity per bout.

inf

Whether to generate data with informative observation and censoring times.

nobs

Average number of physical activity bouts.

Value

A simulated dataset is returned with four columns: [ID, time, min, x1, phi].

Author(s)

Jaejoon Song <jjsong2@mdanderson.org>

Examples

##
## Simulation study when observation and censoring time patterns are noninformative
## Each simulated dataset contains data for 100 individuals
## Two datasets are generated, for illustration purposes
## Expected number of physical activity bouts is 7
##
mysim_ind <- simStudy(n=100,numsim=2,beta=-.4,nu=5,mu=12,inf=FALSE,nobs=7)

##
## Simulation study when observation and censoring time patterns are noninformative
## Each simulated dataset contains data for 100 individuals
## Two datasets are generated, for illustration purposes
## Expected number of physical activity bouts set to 7 when X_i = 1 and Z_i <= 1
## Expected number of physical activity bouts set to 2 when X_i = 0 or Z_i > 1
##
mysim_inf <- simStudy(n=100,numsim=2,beta=-.4,nu=5,mu=12,inf=TRUE,nobs=c(7,2))

github-js/acc documentation built on Aug. 21, 2023, 5:40 p.m.