leverage2 {lavaSearch2} | R Documentation |
Leverage With Small Sample Correction.
Description
Extract leverage values from a latent variable model, with small sample correction.
Usage
leverage2(object, format, ssc, ...)
## S3 method for class 'lvmfit'
leverage2(object, format = "wide", ssc = lava.options()$ssc, ...)
## S3 method for class 'lvmfit2'
leverage2(object, format = "wide", ...)
Arguments
object |
a |
format |
[character] Use |
ssc |
[character] method used to correct the small sample bias of the variance coefficients: no correction ( |
... |
additional argument passed to |
Details
The leverage are defined as the partial derivative of the fitted values with respect to the observations.
leverage_i = \frac{\partial \hat{Y}_i}{\partial Y_i}
See Wei et al. (1998).
When argument object is a lvmfit
object, the method first calls estimate2
and then extract the leverage.
Value
a matrix containing the leverage relative to each sample (in rows) and each endogenous variable (in column).
References
Bo-Cheng Wei et al., Generalized Leverage and its applications (1998), Scandinavian Journal of Statistics 25:1:25-37.
See Also
estimate2
to obtain lvmfit2
objects.
Examples
#### simulate data ####
set.seed(10)
m <- lvm(Y1~eta,Y2~eta,Y3~eta)
latent(m) <- ~eta
d <- lava::sim(m,20, latent = FALSE)
#### latent variable models ####
e.lvm <- estimate(m, data = d)
leverage2(e.lvm)