Learn R Programming

vcrpart (version 0.2-1)

olmm-methods: Methods for olmm objects

Description

Standard methods for computing on olmm objects.

Usage

## S3 method for class 'olmm':
anova(object, ...)

## S3 method for class 'olmm': coef(object, which = c("all", "fe"), ...)

## S3 method for class 'olmm': fixef(object, which = c("all", "ce", "ge"), ...)

## S3 method for class 'olmm': model.matrix(object, which = c("fe", "fe-ce", "fe-ge", "re", "re-ce", "re-ge"), ...)

## S3 method for class 'olmm': neglogLik2(object, ...)

## S3 method for class 'olmm': ranef(object, norm = FALSE, ...)

## S3 method for class 'olmm': ranefCov(object, ...)

## S3 method for class 'olmm': simulate(object, nsim = 1, seed = NULL, newdata = NULL, ranef = TRUE, ...)

## S3 method for class 'olmm': terms(x, which = c("fe-ce", "fe-ge", "re-ce", "re-ge"), ...)

## S3 method for class 'olmm': VarCorr(x, sigma = 1., rdig = 3)

## S3 method for class 'olmm': weights(object, level = c("observation", "subject"), ...)

Arguments

object, x
an olmm object.
which
optional character string. For coef and fixef, it indicates whether "all" coefficients, the fixed effects "fe", the
level
character string. Whether the results should be on the observation level (level = "observation") or on the subject level (level = "subject").
norm
logical. Whether residuals should be divided by their standard deviation.
nsim
number of response vectors to simulate. Defaults to 1.
seed
an object specifying if and how the random number generator should be initialized. See simulate
newdata
a data frame with predictor variables.
ranef
whether the simulated responses should be based on conditional probabilities.
sigma
ignored but obligatory argument from original generic.
rdig
ignored but obligatory argument from original generic.
...
potential further arguments passed to methods.

Details

anova implements log-likelihood ratio tests for model comparisons, based on the marginal likelihood. At the time being, at least two models must be assigned.

neglogLik2 is the marginal maximum likelihood of the fitted model times minus 2.

ranefCov extracts the variance-covariance matrix of the random effects. Similarly, VarCorr extracts the estimated variances, standard deviations and correlations of the random effects.

resid extracts the residuals of Li and Sheperd (2012). By default, the marginal outcome distribution is used to compute these residuals. The conditional residuals can be computed by assigning ranef = TRUE as a supplementary argument. Further, undocumented methods are deviance, extractAIC, fitted, formula, getCall, logLik, model.frame, nobs, update, vcov.

The anova implementation is based on codes of the lme4 package. The authors are grateful for these codes.

References

Agresti, A. (2010). Analysis of Ordinal Categorical Data, 10 edn, Wiley.

Tutz, G. (2012). Regression for Categorical Data, Cambridge Series in Statistical and Probabilistic Mathematics. Li, C. and Sheperd, B. E. (2012). A new residual for ordinal outcomes, Biometrika 99 (2): 437-480

Bates D, Maechler M, Bolker BM and Walker S (2014). lme4: Linear mixed-effects models using Eigen and S4. Submitted to Journal of Statistical Software

See Also

olmm, predict.olmm, gefp.olmm

Examples

Run this code
## --------------------------------------------------------- #
## Example 1: Schizophrenia (see also example of 'olmm')
## --------------------------------------------------------- #

data(schizo)

schizo <- schizo[1:181,]
schizo$id <- droplevels(schizo$id)

## fit two alternative models for the 'schizo' data
model.0 <- olmm(imps79o ~ tx + sqrt(week) + re(1|id), schizo)
model.1 <- olmm(imps79o ~ tx + sqrt(week)+tx*sqrt(week)+re(1|id),schizo)

anova(model.0, model.1)
coef(model.1)
fixef(model.1)
head(model.matrix(model.1, "fe-ge"))
head(weights(model.1))
ranefCov(model.1)
head(resid(model.1))
head(simulate(model.1))
terms(model.1, "fe-ge")
VarCorr(model.1)
head(weights(model.1, "subject"))

Run the code above in your browser using DataLab