leverage2 | R Documentation |
Extract leverage values from a latent variable model, with small sample correction.
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", ...)
object |
a |
format |
[character] Use |
ssc |
[character] method used to correct the small sample bias of the variance coefficients: no correction (code"none"/ |
... |
additional argument passed to |
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.
a matrix containing the leverage relative to each sample (in rows) and each endogenous variable (in column).
Bo-Cheng Wei et al., Generalized Leverage and its applications (1998), Scandinavian Journal of Statistics 25:1:25-37.
estimate2
to obtain lvmfit2
objects.
#### 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.