Learn R Programming

lavaSearch2 (version 1.0.0)

residuals2: Compute the Residuals from a lvmfit Object

Description

Compute the residuals from a lvmfit object.

Usage

residuals2(object, ...)

# S3 method for lm residuals2(object, adjust.residuals = TRUE, return.vcov.param = FALSE, ...)

# S3 method for gls residuals2(object, cluster = NULL, p = NULL, data = NULL, adjust.residuals = TRUE, as.clubSandwich = TRUE, second.order = FALSE, return.vcov.param = FALSE, return.prepareScore2 = FALSE, ...)

# S3 method for lme residuals2(object, cluster = NULL, p = NULL, data = NULL, adjust.residuals = TRUE, as.clubSandwich = TRUE, second.order = FALSE, return.vcov.param = FALSE, return.prepareScore2 = FALSE, ...)

# S3 method for lvmfit residuals2(object, p = NULL, data = NULL, adjust.residuals = TRUE, as.clubSandwich = TRUE, second.order = FALSE, return.vcov.param = FALSE, return.prepareScore2 = FALSE, ...)

Arguments

object

a fitted latent variable model.

...

[internal] Only used by the generic method.

adjust.residuals

Small sample correction: should the leverage-adjusted residuals be used to compute the score? Otherwise the raw residuals will be used.

return.vcov.param

Should the variance covariance matrix of the parameters be included in the output?

cluster

[only required for gls objects] a vector indicating the clusters of observation that are iid.

p

[optional] vector of parameters at which to evaluate the score.

data

[optional] data set.

as.clubSandwich

method to take the square root of a non symmetric matrix. If TRUE use a method implemented in the clubSandwich package.

second.order

should the terms relative to the third derivative of the likelihood be be pre-computed?

return.prepareScore2

should the quantities that have been pre-computed be returned?

Examples

Run this code
# NOT RUN {
m <- lvm(Y1~eta,Y2~eta,Y3~eta)
latent(m) <- ~eta

e <- estimate(m,sim(m,1e2))
residuals2(e)
# }

Run the code above in your browser using DataLab