| residuals.moc {moc} | R Documentation |
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 ).
post(object,...) post(object,...) residuals(object,...,type="deviance",post.weight=TRUE,within=FALSE)
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. |
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 time to detect misspecified regression function or profiles.
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.
Bernard Boulerice <Bernard.Boulerice@umontreal.ca>
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. 785794.
moc,plot.moc,print.moc,
AIC.moc