genSimDataGLMEM {riskPredictClustData}R Documentation

Generate simulated data from logistic mixed effects model based on the AMD data

Description

Generate simulated data from logistic mixed effects model based on the AMD data.

Usage

genSimDataGLMEM(
  nSubj = 131, 
  beta0 = -6, 
  sd.beta0i = 1.58, 
  beta1 = 1.58, 
  beta2 = -3.95, 
  beta3 = 3.15, 
  beta4 = 2.06, 
  beta5 = 0.51, 
  beta6 = 1.47, 
  beta7 = 3.11, 
  p.smkcur = 0.08, 
  p.inieye31 = 0.44, 
  p.inieye32 = 0.42, 
  p.inieye41 = 0.12, 
  p.inieye42 = 0.11, 
  sd.lncalorc = 0.33)

Arguments

nSubj

integer. Number of subjects. Each subject would have data for 2 eyes.

beta0

mean of intercept β0i\beta_{0i}, which is assumed random and follows normal distribution N(β0,σβ2)N(\beta_0, \sigma^2_{\beta})

sd.beta0i

standard deviation σβ2\sigma^2_{\beta} of the random intercept β0i\beta_{0i}.

beta1

slope for the binary covariate cursmkcursmk (current smoking status). cursmk=1cursmk=1 indicates current smokers. cursmk=0cursmk=0 indicates past smokers or never smokers.

beta2

slope for the continuous mean-centered covariate lncalorclncalor_c.

beta3

slope for the binary covariate inieye3inieye3 indicating if an eye of a subject has initial grade equal to 3. inieye3=1inieye3=1 indicates the eye has initial grade equal to 3.

beta4

slope for the binary covariate inieye4inieye4 indicating if an eye of a subject has initial grade equal to 4. inieye4=1inieye4=1 indicates the eye has initial grade equal to 4.

beta5

slope for the binary covariate rtotfat1rtotfat_1 indicating if the subject's total fat intake is in the 2nd quartile of total fat intake. rtotfat1=1rtotfat_1=1 indicates the subject is in the 2nd quartile.

beta6

slope for the binary covariate rtotfat2rtotfat_2 indicating if the subject's total fat intake is in the 3rd quartile of total fat intake. rtotfat2=1rtotfat_2=1 indicates the subject is in the 3rd quartile.

beta7

slope for the binary covariate rtotfat3rtotfat_3 indicating if the subject's total fat intake is in the 4th quartile of total fat intake. rtotfat3=1rtotfat_3=1 indicates the subject is in the 4th quartile.

p.smkcur

proportion of current smokers.

p.inieye31

proportion of left eye having inital grade equal to 3.

p.inieye32

proportion of right eye having inital grade equal to 3.

p.inieye41

proportion of left eye having inital grade equal to 4.

p.inieye42

proportion of right eye having inital grade equal to 4.

sd.lncalorc

standard deviation for lncalorclncalor_c.

Details

We generate simulated data set from the following generalized linear mixed effects model:

log(pij(1pij))=β0i+β1smkcuri+β2lncalorci+β3inieye3ij+β4inieye4ij+β5rtotfat1i+β6rtotfat2i+β7rtotfat3i,\log\left(\frac{p_{ij}}{(1-p_{ij})}\right)=\beta_{0i}+\beta_1 smkcur_i+ \beta_2 lncalor_{ci} + \beta_3 inieye3_{ij} + \beta_4 inieye4_{ij} +\beta_5 rtotfat_{1i} +\beta_6 rtotfat_{2i} + \beta_7 rtotfat_{3i},

i=1,,N,j=1,2i=1,\ldots, N, j=1, 2, β0iN(β0,σβ2).\beta_{0i}\sim N\left(\beta_0, \sigma^2_{\beta}\right).

Value

A data frame with 8 columns: cid, subuid, prog, smkcur, lncalorc, inieye3, inieye4, and rtotfat, where cid is the subject id, subuid is the unit id, and prog is the progression status. prog=1prog=1 indicates the eye is progressed. prog=0prog=0 indicates the eye is not progressed. There are nSubj*2 rows. The first nSubj rows are for the left eyes and the second nSubj rows are for the right eyes.

Author(s)

Bernard Rosner <stbar@channing.harvard.edu>, Weiliang Qiu <Weiliang.Qiu@gmail.com>, Meiling Ting Lee <MLTLEE@umd.edu>

References

Rosner B, Qiu W, and Lee MLT. Assessing Discrimination of Risk Prediction Rules in a Clustered Data Setting. Lifetime Data Anal. 2013 Apr; 19(2): 242-256.

Examples


set.seed(1234567)
datFrame = genSimDataGLMEM(nSubj = 30, beta0 = -6, sd.beta0i = 1.58, 
                          beta1 = 1.58, beta2 = -3.95, beta3 = 3.15, beta4 = 2.06,
                          beta5 = 0.51, beta6 = 1.47, beta7 = 3.11, 
                          p.smkcur = 0.08, p.inieye31 = 0.44, p.inieye32 = 0.42,
                          p.inieye41 = 0.12, p.inieye42 = 0.11, sd.lncalorc = 0.33)
print(dim(datFrame))
print(datFrame[1:2,])

[Package riskPredictClustData version 0.2.6 Index]