Posterior classification stemmed from a hlme
, lcmm
,
multlcmm
or Jointlcmm
estimation
Source: R/postprob.hlme.R
postprob.Rd
This function provides informations about the posterior classification
stemmed from a hlme
, lcmm
, multlcmm
, Jointlcmm
,
mpjlcmm
, externSurv
or externX
object.
Usage
postprob(x, threshold = c(0.7, 0.8, 0.9), ...)
Arguments
- x
an object inheriting from classes
hlme
,lcmm
,Jointlcmm
ormultlcmm
representing respectively a fitted latent class linear mixed-effects model, a more general latent class mixed model, a joint latent class model or a multivariate general latent class mixed model.- threshold
optional vector of thresholds for the posterior probabilities
- ...
further arguments to be passed to or from other methods. They are ignored in this function.
Value
A list containing the posterior classification, the posterior classification table and the percentage of subjects classified with a posterior probability above the given thresholds.
Details
This function provides the number of subjects classified a posteriori in
each latent class, the percentage of subjects classified with a posterior
probability above a certain threshold, and the classification table that
contains the mean of the posterior probability of belonging to each latent
class over the subjects classified in each of the latent classes. This table
aims at evaluating the quality of the posterior classification. For
hlme
, lcmm
objects, the posterior classification and the
classification table are derived from the posterior class-membership
probabilities given the vector of repeated measures that are contained in
pprob output matrix. For a Jointlcmm
object, the first posterior
classification and the classification table are derived from the posterior
class-membership probabilities given the vector of repeated measures and the
time-to-event information (that are contained in columns probYT1, probYT2,
etc in pprob output matrix). The second posterior classification is derived
from the posterior class-membership probabilities given only the vector of
repeated measures (that are contained in columns probY1, probY2, etc in
pprob output matrix).
Note
This function can only be used with latent class mixed models and joint latent class mixed models that include at least 2 latent classes
Examples
m<-lcmm(Y~Time*X1,mixture=~Time,random=~Time,classmb=~X2+X3,
subject='ID',ng=2,data=data_hlme,B=c(0.41,0.55,-0.18,-0.41,
-14.26,-0.34,1.33,13.51,24.65,2.98,1.18,26.26,0.97))
postprob(m)
#>
#> Posterior classification:
#> class1 class2
#> N 59 41
#> % 59 41
#>
#> Posterior classification table:
#> --> mean of posterior probabilities in each class
#> prob1 prob2
#> class1 1 0
#> class2 0 1
#>
#> Posterior probabilities above a threshold (%):
#> class1 class2
#> prob>0.7 100 100
#> prob>0.8 100 100
#> prob>0.9 100 100
#>