Closed ihrke closed 2 months ago
Hi,
Is res$Estimates$Proxy_VCV
or res$Estimates$Construct_VCV
what you're looking for?
Michael
I don't think so - these seem to be the covariances between the latent variables/constructs themselves but not between the estimated regression coefficients, right?
True, I didn't even know this was a thing--I was under the impression that this isn't something to be computed. I think someone else would be better suited to answer
@ihrke : Hey, there is no function to extract the variance-covariance matrix of the parameters. The main reason for that is that there is no closed-form expression for that and the SEs of the parameters are determined via bootstrap. What you could do is run the model with bootstrap, i.e., .resample_method = 'bootstrap' The resulting cSEM object contains now the bootstrap results: fit$Estimates$Estimates_resample Using these estimates, you can estimate the variance-covariance matrix of the parameters estimates. In the following a small example for the variance-covariance matrix of the path coefficients: model <- " EXPE ~ IMAG QUAL ~ EXPE VAL ~ EXPE + QUAL SAT ~ IMAG + EXPE + QUAL + VAL LOY ~ IMAG + SAT
IMAG <~ imag1 + imag2 + imag3 EXPE <~ expe1 + expe2 + expe3 QUAL <~ qual1 + qual2 + qual3 + qual4 + qual5 VAL <~ val1 + val2 + val3
SAT =~ sat1 + sat2 + sat3 + sat4 LOY =~ loy1 + loy2 + loy3 + loy4 "
res <- csem(.data = satisfaction, .model = model,.resample_method = 'bootstrap') cov(res$Estimates$Estimates_resample$Estimates1$Path_estimates$Resampled)
Does this help?
That's what I was looking for, thanks a lot @FloSchuberth!
I am trying to extract the estimated covariance matrix of the parameter estimates from the fitted model in
cSEM
. Inlavaan
, thevcov()
method returns this matrix but the function is not implemented for the classcSEMResults
. I could not find it in theEstimates
field of the fitted model either. Is there a way to extract that matrix from the model object?