library('lcmm');
data(data_hlme)
head(data_hlme)
- データは経時的に観察するYと観察時刻Timeが各行で異なり、それ以外の共変量は個人の番号IDと同様観測回数ごとに繰り返して入力されている形式。以下では、ID=(1,2)の2人分のデータが見えている
> head(data_hlme)
ID Y Time X1 X2 X3
1 1 22.820 1.831 1 1 1.163
2 1 20.622 3.831 1 1 1.163
3 1 18.340 5.831 1 1 1.163
4 2 24.390 0.089 1 0 0.411
5 2 21.015 2.089 1 0 0.411
6 2 18.188 4.089 1 0 0.411
m<-lcmm(Y~Time*X1,mixture=~Time,random=~Time,classmb=~X2+X3,
subject='ID',ng=2,data=data_hlme,link="linear")
summary(m)
> summary(m)
> summary(m)
General latent class mixed model
fitted by maximum likelihood method
lcmm(fixed = Y ~ Time * X1, mixture = ~Time, random = ~Time,
subject = "ID", classmb = ~X2 + X3, ng = 2, link = "linear",
data = data_hlme)
Statistical Model:
Dataset: data_hlme
Number of subjects: 100
Number of observations: 326
Number of latent classes: 2
Number of parameters: 13
Link function: linear
Iteration process:
Convergence criteria satisfied
Number of iterations: 17
Convergence criteria: parameters= 1e-05
: likelihood= 1.4e-05
: second derivatives= 7.7e-12
Goodness-of-fit statistics:
maximum log-likelihood: -773.82
AIC: 1573.64
BIC: 1607.51
Maximum Likelihood Estimates:
Fixed effects in the class-membership model:
(the class of reference is the last class)
coef Se Wald p-value
intercept class1 -0.10518 0.33396 -0.315 0.75280
X2 class1 0.73939 0.48979 1.510 0.13114
X3 class1 0.06818 0.19284 0.354 0.72366
Fixed effects in the longitudinal model:
coef Se Wald p-value
intercept class1 (not estimated) 0.00000
intercept class2 -8.97287 0.77084 -11.640 0.00000
Time class1 0.13534 0.17844 0.758 0.44817
Time class2 -1.03737 0.21216 -4.890 0.00000
X1 2.53261 0.68591 3.692 0.00022
Time:X1 -0.29719 0.20777 -1.430 0.15262
Variance-covariance matrix of the random-effects:
intercept Time
intercept 4.8025533
Time 0.3839559 0.8465551
Residual standard error (not estimated) = 1
Parameters of the link function:
coef Se Wald p-value
Linear 1 (intercept) 29.39251 0.54904 53.534 0
Linear 2 (std err) 0.96808 0.06066 15.959 0