Manova in lavaan

130 views
Skip to first unread message

Michal Levinsky

unread,
Dec 13, 2020, 5:48:02 PM12/13/20
to lavaan
Hi, I would love to get some help.

I have two independent variables  - x, z. And two dependent variables - y1, Y2. Everything tests on the same people, that is, each subject has scored in all four vars.  My questions:

1. Is it correct to do the analysis like this:
Model <- '
Y1 ~ X + Z
Y2 ~ X + Z ' 
does Lavaan alone understand that it is repeated measures?

2. Is it possible to say that it is actually MANOVA in SEM? Is there a difference between the two methodological ways of analysis? should I have to use the MANOVA package instead of sem?

3. The situation gets complicated, and I have this analysis for 2 different groups. That means, I have a variable G that has 2 values, and I want the same analysis of no.1 for the two groups but with a statistical comparison between them. How can I do that?

Thanks!

Jeremy Miles

unread,
Dec 13, 2020, 10:20:30 PM12/13/20
to lav...@googlegroups.com
'
1 & 2. Yes, that's a manova.

It takes into account the correlation in the residual variances of Y1 and Y2, and you can do univariate or multivariate tests (I find the SEM framework much more straightforward to understand than manova). 

3.  I think that you're talking about a multiple group analysis? I'm not sure. Why not to 

Y1 ~ X + Z + G
Y2 ~ X + Z  + G

What do you want to compare?

 





--
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 view this discussion on the web visit https://groups.google.com/d/msgid/lavaan/47c53a10-d65b-4e10-b0e7-f4de764192e5n%40googlegroups.com.

Michal Levinsky

unread,
Dec 14, 2020, 3:42:39 AM12/14/20
to lav...@googlegroups.com

Thanks for the quick reply! You helped me a lot. 
1+2. In other words, if I do the same analysis at Manova will I get similar results? By the way, the two ID variables are continuous, is that okay?

3. That's not exactly what I want. What I need is actually more appropriate for inserting the variable G in interacting with each of the IDs (I want to test how each of the IDs affects the Ds compared to the two groups). But because I'll have more than two ID at the end, it's a little complicated. A second option is to add a group option to the analysis (in sem(fit, data=, group=)) and then I can see what happens to the two groups separately, but then I have no statistical reinforcement for the differences between the groups.
any suggestions?

You received this message because you are subscribed to a topic in the Google Groups "lavaan" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/lavaan/ApFB3YKTD8A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to lavaan+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lavaan/CAMtGSxkGam_DeVf1YhLws9p%2B_1u7w77%2BZhJPwcWqRdeb2f6Reg%40mail.gmail.com.

Patrick (Malone Quantitative)

unread,
Dec 14, 2020, 10:24:12 AM12/14/20
to lav...@googlegroups.com
I think the only real difference is that lavaan defaults to a maximum likelihood estimator and MANOVA usually to a least squares estimator. If assumptions are met, these should give essentially the same results. You could explore this by trying different estimators in lavaan and comparing to a MANOVA program's output.



--
Patrick S. Malone, Ph.D., Malone Quantitative
NEW Service Models: http://malonequantitative.com

He/Him/His

Michal Levinsky

unread,
Dec 16, 2020, 3:52:48 AM12/16/20
to lav...@googlegroups.com
Ok, Thank you very much!

Any suggestions regarding the group issue?

Patrick (Malone Quantitative)

unread,
Dec 16, 2020, 8:42:06 AM12/16/20
to lav...@googlegroups.com
In MANOVA, you would do this with an interacting factor. In lavaan, you can either do that (have a product term fo G*X and G*Z, and arguably X*Z and G*X*Z just in case) or have a multiple-group model where you have finer control over what parameters are fixed or freed between groups.

Pat

Jeremy Miles

unread,
Dec 16, 2020, 12:05:23 PM12/16/20
to lav...@googlegroups.com
On Mon, 14 Dec 2020 at 00:42, Michal Levinsky <michal....@mail.huji.ac.il> wrote:

Thanks for the quick reply! You helped me a lot. 
1+2. In other words, if I do the same analysis at Manova will I get similar results? By the way, the two ID variables are continuous, is that okay?


What are the ID variables?
 
3. That's not exactly what I want. What I need is actually more appropriate for inserting the variable G in interacting with each of the IDs (I want to test how each of the IDs affects the Ds compared to the two groups). But because I'll have more than two ID at the end, it's a little complicated. A second option is to add a group option to the analysis (in sem(fit, data=, group=)) and then I can see what happens to the two groups separately, but then I have no statistical reinforcement for the differences between the groups.
any suggestions?


Yes, you can do a multiple groups analysis.

With two groups (a and b), something like:

Y1 ~ c(xy1_a, xy1_b) * X + c(zy1_a, zy1_a) * Z 
Y2 ~ c(xy2_a, xy2_b) * X + c(zy2_a, zy2_b) * Z  

Y1 ~ c(mean_1_a, mean_1_b) * 1
Y2 ~ c(mean_2_a, mean_2_b) * 1

If you want to see the effect of group (a and b) on Y1:
mean_1_a == mean_1_b

If you want to do a multivariate test of the effect of group:
mean_1_a == mean_1_b
mean_2_a == mean_2_b

Similarly, a  test of X on Y1 across groups:
xy1_a == xy1_b

A mulitivariate test oc X on Y1 AND y2.
xy1_a == xy1_b
xy2_a == xy2_b

Etc.
I find this much clearer than manova, as it's clearer what you are testing each time.

Also, instead of writing the whole model each time, you can build it from parts.

something liike:
base_model <- "
  Y1 ~ c(xy1_a, xy1_b) * X + c(zy1_a, zy1_a) * Z 
  Y2 ~ c(xy2_a, xy2_b) * X + c(zy2_a, zy2_b) * Z  
  " 

test_group_model_y1 = paste0(base_model, "\nmean_1_a == mean_1_b")
test_group_model_y2 = paste0(base_model, "\nmean_2_a == mean_2_b")
test_group_model_mv = paste0(base_model, "
  mean_1_a == mean_1_b
  mean_2_a == mean_2_b
  ")
 etc.

Then you can fit this model. (You can even put them in a list and fit them all at once.)

(This is a great advantage of lavaan being embedded inside a programming language like R - you can write code to generate 1000 models, fit them and extract the info that you want. [I did this once when I wanted to run a best subsets regression in lavaan]).

Hope that helps,

Jeremy



 

Michal Levinsky

unread,
Dec 18, 2020, 4:22:12 AM12/18/20
to lav...@googlegroups.com


Thank you so much, I found your explanations so helpful!!! so detailed, that very nice:-)

One last thing, I would not really appreciate your help, because I'm lost...:


I have another model that has four dependent variables -  y1 y2 d1 d2. These are repeated measurements, and I want to put them all in Manova as dependents:

Model <- '
Y1 ~ X + Z
Y2 ~ X + Z
D1 ~ X + Z
D2  ~ X + Z
 '
The thing is that Y and D were measured in different situations, and I want to understand, in addition to the model, whether there are differences between the situations (y1, y2 vs d1 d2). Is it possible to check such a thing? In this case, basically, the sample is not divided into two parts, but the dependents are.
I would be glad to any ideas for both using Manova and SEM.
many thanks!

Patrick (Malone Quantitative)

unread,
Dec 18, 2020, 9:01:10 AM12/18/20
to lav...@googlegroups.com
Michael,

I'm not sure what you want by "differences between the situations." Do you want situation as a moderator of X and Z? One way you could do that is test equality constraints between the X ~ Y1 and X ~ D1 paths, and so on for the cross-combinations of X and Z to 1 and 2.

Pat

Michal Levinsky

unread,
Dec 20, 2020, 2:42:17 AM12/20/20
to lav...@googlegroups.com
Okay, thank you so much Patrick!
I will try to explain exactly what I mean:
How can I statistically relate to the fact that Y1 and D1 are almost the same questionnaires, only in different situations, so about Y2 and D2? and that Y1 and Y2 are from a different situation than D1 and D1?
Because it looks to me that it's not exactly the same as inserting four completely different dependent variables.
Maybe there is no need to get involved, and once I put the four into the same model I can just see what is different from what?

To make it clear - Y are variables in the situation of a bystander, and D are variables in the situation of involvement.
Y1 - self-confidence in a bystander situation
Y2 - attitudes in a bystander situation
D1 - self-confidence in involvement situation
D2 - attitudes  in involvement situation

Is it right to put everyone simply into the same model as I did before:


Model <- '
Y1 ~ X + Z
Y2 ~ X + Z
D1 ~ X + Z
D2  ~ X + Z
 '

Patrick (Malone Quantitative)

unread,
Dec 20, 2020, 9:14:00 AM12/20/20
to lav...@googlegroups.com
Michael,

The syntax is fine--it will return a 4-dv MANOVA analog. I was just suggesting you may want to explore/impose equality constraints on paths to DVs of the same type. For example, a research question might be, do the effects of X and Z on self-confidence differ between bystander and involvement situations--are the path coefficients the same in the Y1 and the D1 equaations? The vignettes in the lavaan tutorial should help you here.

Michal Levinsky

unread,
Dec 21, 2020, 7:25:30 AM12/21/20
to lav...@googlegroups.com
Ok, thank you so much!!! it was really helpful.

Michal Levinsky

unread,
Dec 27, 2020, 3:38:07 PM12/27/20
to lav...@googlegroups.com
Hello again, 
So I tried to run the basic model, and got degrees of freedom equal to zero, cfi tli to one. I understand that the model is called justidentify:

Model <- '
Y1 ~ X + Z
Y2 ~ X + Z
D1 ~ X + Z
D2  ~ X + Z
 '
What's wrong with that, and how (if needed) can I change anything here?


בתאריך יום ב׳, 21 בדצמ׳ 2020, 13:25, מאת Michal Levinsky ‏<michal....@mail.huji.ac.il>:

Patrick (Malone Quantitative)

unread,
Dec 27, 2020, 3:42:08 PM12/27/20
to lav...@googlegroups.com
Conventional regression models without latent variables, which include ANOVA and MANOVA as subsets, are generally saturated, with all covariances allowed among independent variables, likewise among disturbances of dependent variables, and all paths from all independent to all dependent variables. So your equivalent in lavaan is, too. Nothing to worry about.

Michal Levinsky

unread,
Dec 27, 2020, 4:53:39 PM12/27/20
to lav...@googlegroups.com
Thanks, Patrick, for the quick reply! I do not have enough words to thank. 
So how do I actually report the findings in an article? What are the fit measures that reflect the quality of the model?

בתאריך יום א׳, 27 בדצמ׳ 2020, 21:42, מאת Patrick (Malone Quantitative) ‏<mal...@malonequantitative.com>:

Patrick (Malone Quantitative)

unread,
Dec 27, 2020, 6:03:20 PM12/27/20
to lav...@googlegroups.com
If your goal is to replicate MANOVA, fit is not relevant or tested (or testable).

Reply all
Reply to author
Forward
0 new messages