Description Usage Arguments Details Value Author(s) References Examples
View source: R/cumres.lvmfit.R
Calculates GoF statistics based on cumulative residual
processes for structural equation models fitted with the
lava
package.
1 2 3 4 5 |
model |
|
y |
A formula specifying the association to be checked. Alternatively the outcome specified as a function or a string with the name of the outcome in the model. |
x |
Predictor. A function, vector or character |
full |
If FALSE the prediction, Pr, of the variable that are ordered after is only calculated based on the conditional distribution given covariates. If TRUE the conditional expectation is based on the largest set of covariates and endogenous variables such that the residual and Pr are uncorrelated. |
data |
data.frame (default is the model.frame of the model) |
p |
Optional parameter vector |
R |
Number of processes to simulate |
b |
Moving average parameter |
plots |
Number of processes to save for use with the plot method |
seed |
Random seed |
... |
Additional arguments parsed on to lower-level functions |
With y
and x
given as functions the user
can decide which variables to use in the prediction of
the outcome and predictor (use the predict
method
as below).
Returns a cumres
object with associated
plot
,print
,confint
methods
Klaus K. Holst
B.N. Sanchez and E. A. Houseman and L. M. Ryan (2009) Residual-Based Diagnostics for Structural Equation Models. Biometrics Volume 65 (1), pp 104-115.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | library(lava)
m <- lvm(list(c(y1,y2,y3)~eta,eta~x)); latent(m) <- ~eta
## simulate some data with non-linear covariate effect
functional(m,eta~x) <- function(x) 0.3*x^2
d <- sim(m,100)
e <- estimate(m,d)
## Checking the functional form of eta on x
g <- cumres(e,eta~x,R=1000)
plot(g)
x <- function(p) predict(e,x=~y2+y3,p=p)[,"eta"]
## Checking the functional form of y1 on eta
cumres(e,y1~eta,R=1000)
g <- cumres(e,"y1",x=x,R=1000)
plot(g)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.