xclass: Cross classifications

Description Usage Arguments Value Author(s) Examples

View source: R/xclass.R

Description

This function crosses the posterior classifications of two estimated models

Usage

1
xclass(m1, m2)

Arguments

m1

an object inheriting from classes hlme, lcmm, multlcmm, Jointlcmm or mpjlcmm

m2

an object inheriting from classes hlme, lcmm, multlcmm, Jointlcmm or mpjlcmm

Value

the contingency table of the two classifications

Author(s)

Viviane Philipps and Cecile Proust-Lima

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Estimation of the models
m2 <- hlme(Y~Time*X1,mixture=~Time,random=~Time,classmb=~X2+X3,subject='ID',ng=2,
data=data_hlme,B=c(0.11,-0.74,-0.07,20.71,29.39,-1,0.13,2.45,-0.29,4.5,0.36,0.79,0.97))
m3 <- hlme(fixed = Y ~ Time * X1, mixture = ~Time, random = ~Time,subject = "ID",
classmb = ~X2 + X3, ng = 3, data = data_hlme,B=c(-0.21, 0.31, -2.11, -0.81, -0.24,
-0.18, 25.4, 20.09, 30.18, -0.43, -1.1, 0.25, 2.37, -0.29, 2.34, 0.03, 0.74, 0.97))

## Compare the classifications
xclass(m2,m3)
# The 39 subjects in class 2 of m3 come from class 1 of m2.
# In the same way, all the subjects in class 3 come from class 2 of m2.
# Class 1 of m3 mixes subject from class 1 and class 2 of m2.

CecileProust-Lima/lcmm documentation built on Feb. 27, 2021, 4:06 p.m.