Learn R Programming

moc (version 2.0)

print.moc: Summary methods for fitted MOC models

Description

print.moc prints information contained in a fitted moc object. The attributes parameters of the functions gmu, gshape, gextra and gmixture will be used to label the output.

coef.moc returns the coefficients (estimated parameters) of a fitted moc object.

fitted.moc computes the expected values for each observation of a moc object using its expected function.

obsfit.moc computes and prints the mean posterior probabilities and the posterior means of a user specified function of the expected and observed values, separated with respect to the specified variable.

Usage

# S3 method for moc
print(x, digits = 5, expand = TRUE, transpose = FALSE, …)

# S3 method for moc coef(object, split=FALSE, …)

# S3 method for moc fitted(object, …)

obsfit.moc(object, along = list(cons = rep(1, object$nsubject)), FUN = function(x) x)

Arguments

x, object

Objects of class moc.

split

If split is TRUE, returns a list with elements corresponding to mu, shape, extra and mixture parameters.

digits

Number of digits to be printed.

expand

Expand density, gmu, gshape, gextra, gmixture function body in the print.

transpose

Transpose fitted.mean and observed.mean in the print.

along

Splitting variable.

FUN

User defined function to apply to observed and expected values.

Unused.

Value

All these methods return their results invisibly.

Details

obsfit.moc will first compute the posterior probabilities for all subjects in each mixture using post.moc and then the weighted posterior mean probabilities $$\hat{\bar{\tau}}_k = \frac{\sum_i wt_i\,\hat{\tau}_{i,k}} {\sum_i wt_i}$$ The weighted posterior means of a function \(g()\) of the data (which are the empirical estimators of the conditional expectation given mixture group) are computed as $$\frac{\sum_i wt_i\,\hat{\tau}_{i,k}\,g(y_i)}{\sum_i wt_i\,\hat{\tau}_{i,k}}$$ where both sums are taken over index of valid data \(y_i\).

See Also

moc, residuals.moc, post.moc, plot.moc, AIC.moc