residuals.moc {moc}R Documentation

Posterior and residuals methods for MOC models

Description

post is a generic method for computing posterior probabilities of a fitted model.

post.moc computes the posterior mixture probabilities of each subject.

residuals.moc computes response or deviance residuals. The residuals are optionally weighted by the posterior mixture probabilities, globally ( with post ) or within each group ( in that case post is divided by its mean for each group ).

Usage


   post(object,...)
   
   ## S3 method for class 'moc':
   post(object,...)

   ## S3 method for class 'moc':
   residuals(object,...,type="deviance",post.weight=TRUE,within=FALSE)

Arguments

object Object of class moc.
type Type of residuals: either deviance ( the default ) or response.
post.weight Specify if the residuals must be weighted by the posterior mixture probabilities. Weighting is preferable, it is the default.
within Specify if the posterior weights are rescaled within each mixture group.
... Unused.

Details

Response residuals are simply the difference between the observed and expected values,

response = y - expected

Deviance residuals are defined as properly scaled difference in the log likelihood at the observed and fitted value.

deviance = sqrt(2 * wt * (log(density(y,y,shape,extra)/density(y,mu,shape,extra)))) * sign(response)

Globally weighted residuals are preferable to detect influential data, wrong number of groups and differences between groups. Rescaled weight residuals are more useful when plotted against some variables or variable index to detect misspecified regression function or profiles.

Value

residuals.moc returns an array of class residuals.moc and residuals with attributes type, post.weight and within. All these methods return their values invisibly.

Author(s)

Bernard Boulerice <Bernard.Boulerice@umontreal.ca>

References

McLachlan, G. and Peel, D. (2000) Finite mixture models,Wiley-Interscience, New York.

Lindsay, B. G. and Roeder, K. (1992) Residual diagnostics for mixture models, J. Amer. Statist. Assoc., 87, pp. 785–794.

See Also

moc,plot.moc,print.moc, AIC.moc


[Package Contents]