simRtc: Simulates minutes of physical activity in continuos time

View source: R/simRtc.R

simRtcR Documentation

Simulates minutes of physical activity in continuos time

Description

Simulates minutes of physical activity in continuous time

Usage

simRtc(n,beta,nu,mu,inf,nobs)

Arguments

n

Number of individuals in the simulated data.

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]. The number of physical activity minutes 'min' is generated as mu*Z_i*exp(X_i*beta), where the expected number of bouts is 'nobs'.

Author(s)

Jaejoon Song <jjsong2@mdanderson.org>

Examples

##
## Simulauting data for a 50 individuals 
## with noninformative observation and censoring time patterns
##
simdata <- simRtc(n=50,beta=-.4,nu=5,mu=12,inf=FALSE,nobs=7)

##
## Simulauting data for a 50 individuals 
## with informative observation and censoring time patterns
##
simdata <- simRtc(n=50,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.