lavSpatialCorrect stopped producing output

75 views
Skip to first unread message

Kyle Haynes

unread,
Apr 7, 2016, 2:16:27 PM4/7/16
to lavaan
Hi all,

In the recent past I have successfully used lavaan to run a SEM model and then used lavSpatialCorrect to account for spatial autocorrelation. However, lavSpatialCorrect no longer seems to be working for me. Has anyone else had this problem or know of a possible solution?

I have successfully fit a model using the 'sem' lavaan command and get output with the 'summary' command:

> fit <- sem(model, data = data_sem, estimator = "MLM")
> summary(fit, standardized=TRUE)

The output says the model converged normally and all looks reasonable in the output.

However, when I follow up with:


> source(./lavSpatialCorrect.R")
> library(ape)
> lavSpatialCorrect(fit, data_sem$X, data_sem$Y)


The output is only:

$Morans_I
named list()

$parameters
named list()


So, I am not getting the adjusted results.

Thanks all,
Kyle

Jarrett Byrnes

unread,
Apr 7, 2016, 2:19:42 PM4/7/16
to lav...@googlegroups.com
It’s come to my attention that lavaan no longer produces proper residuals. Please don’t use lavSpatialCorrect until this is fixed.  You can calculate residuals yourself manually by now and feed them in, but for the moment, don’t use the function with a lavaan object.


Can it be temporarily disabled in the relevant package?

--
You received this message because you are subscribed to the Google Groups "lavaan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lavaan+un...@googlegroups.com.
To post to this group, send email to lav...@googlegroups.com.
Visit this group at https://groups.google.com/group/lavaan.
For more options, visit https://groups.google.com/d/optout.

Kyle Haynes

unread,
Oct 5, 2016, 1:07:49 PM10/5/16
to lavaan
Hi again,

I would like to follow up on a previous issue.  Has the problem with lavaan residuals been corrected?  Is it now possible to use lavSpatialCorrect?

Thanks,
Kyle

Yves Rosseel

unread,
Oct 7, 2016, 2:46:58 AM10/7/16
to lav...@googlegroups.com
Not in 0.5-22.

You seem to suggest that this is something that is 'broken' in lavaan,
and needs to be fixed, but the fact of the matter is that
resid(,"casewise") was never intended to be used in
observed-variables-only settings, as explained in many posts, including
here: https://github.com/yrosseel/lavaan/issues/44

It may be difficult to understand for many of you who do not use latent
variables, but predicting the values of observed variables in a full SEM
model (including a structural part) is not trivial *in general*.

Nevertheless, I will study this and see if I can find a solution.

Yves.
> --
> You received this message because you are subscribed to the Google
> Groups "lavaan" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to lavaan+un...@googlegroups.com
> <mailto:lavaan+un...@googlegroups.com>.
> To post to this group, send email to lav...@googlegroups.com
> <mailto:lav...@googlegroups.com>.

Kyle Haynes

unread,
Oct 7, 2016, 8:57:59 AM10/7/16
to lavaan
Thank you for the clarification!

Kyle
Reply all
Reply to author
Forward
0 new messages