Contextual effect for twolevel SEM PreviousNext
Mplus Discussion > Multilevel Data/Complex Sample >
 Student 09 posted on Saturday, December 27, 2008 - 3:04 am

I wonder how to correctly compute a contextual effect when using a twolevel SEM with latent factors.

Following Raudenbush and Bryk (2002, p. 141), for models with groupmean-centering the contexual effect is computed as

beta_between - beta_within.

This could straigtforward be applied to a model where one regresses e.g.
latent factor Y on latent factor X on both levels, and then computes the differences in the unstandardized beta`s. Would this be correct? If so, how could I test the significance of any difference between these two beta`s?

 Bengt O. Muthen posted on Friday, January 02, 2009 - 8:10 am
This topic is a little involved, which has delayed our answer. There has been some work done on this and we are checking if this is ready to be distributed. One key issue which the observed variable case of R&B doesn't face, is that the formula you give would only be relevant if the within and between factor loadings were equal so you are sure you are dealing with the same latent variable on both levels. That equality often does not hold.
 Student 09 posted on Monday, January 05, 2009 - 9:55 am
Dear Dr. Muthen

I would be very grateful if you would notify me once your work is published - if you are aware of any further published research reports in this field (I am not) please let me know

 Student 09 posted on Monday, February 16, 2009 - 2:20 am
Dear Dr. Muthen

according to Bryk and Raudenbush (2002, 141), a contexual effect can - besides the grandmean-centred centered approach (e.g. ex9.1a & ex9.1b)- also be computed as: b_between - b_within = b_contextual.

A potential limitation of this approach is that one gets no information whether the resulting difference is significantly different from zero.

To obtain this information apart from the grand-mean centered approach, I am curious whether it would be correct to

A) constrain the within- and between-regression weights of the variable of interest to equality and then

B) compare the fit of a constrained (b_between = b_within) to an unconstrained (b_between /= b_within) model. Then,

C) if the fit of the constrained model would not differ from the unconstrained model, I would argue that the contextual effect (b_between - b_within) is not significant.

Would this procedure be correct?

 Bengt O. Muthen posted on Monday, February 16, 2009 - 6:31 am
See page 231 of the Version 5 User's Guide for how to get this significance information using Model Constraint. See also

Lüdtke, O., Marsh, H.W., Robitzsch, A., Trautwein, U., Asparouhov, T., & Muthén, B. (2008). The multilevel latent covariate model: A new, more reliable approach to group-level effects in contextual studies. Psychological Methods, 13, 203-229.

under Papers, Multilevel SEM.
 Student 09 posted on Monday, February 16, 2009 - 7:42 am
Thanks, I'll check the Ludtke paper. In the meantime, let me ask whether it is correct that the within-slopes must be invariant (=fixed coefficients, variance between groups) for estimating contextual effects?

Thanks a lot!
 Student 09 posted on Monday, February 16, 2009 - 8:22 am
Thanks for the Ludtke et al. reference which, for the time being, clarified my earlier questions.
 Bengt O. Muthen posted on Monday, February 16, 2009 - 8:24 am
The contextual model uses fixed slopes. See the reference our UG gives: Raudenbush & Bryk 2002, p. 140.
 Student 09 posted on Tuesday, February 17, 2009 - 6:40 am

I am still not clear for which reason grandmean-centering is used in ex9.1b.

I noted that deactivating grandmean-centering yields almost identical results, the only difference being that the y-intercept with grandmean-centered X is 2.036, but without grandmean-centered X the y-intercept is 2.005.

From the UG, I understand that in line with the 'group mean example' by R&B (table 5.11, p. 140), in ex.9.1b beta_c is calculated as gamma01 - gamma10.

For this way of calculating contextual effects R&B do not use grand-mean (X..), but group-mean (X.j) centering only.

Grand-mean centering is used in the right hand example of table 5.11. But because in this second example beta_c is equal to gamma01, this procedure obviously differs from the way contextual effects are estimated in ex9.1.b. That's were my confusion comes from.

So at the risk of asking something very obvious or which could be deduced from the Luedtke et al. paper, I would be very grateful if you could give me an answer a) whether and if so,
b) for which reason grandmean-centering must be used in ex9.1b-types of analysis?

Many thanks for your answer!
 Bengt O. Muthen posted on Tuesday, February 17, 2009 - 10:55 am
Grand-mean centering is not essential for ex9.1b.
 Simon Denny posted on Thursday, August 27, 2009 - 4:27 pm
I have been looking at the paper by Ludtke et al(2008) as I am running a contextual analysis of school climate.

I have a question regarding the paper which is confusing me. On page 207 it states
"Thus, y10 is the specific effect of the group mean after controlling for interindividual differences on X." (1st para top of page)

Shouldn't this be y01 as the contextual effect?

Thanks for your help!
 Linda K. Muthen posted on Friday, August 28, 2009 - 12:51 pm
Oliver Ludtke says it is a typo. "It should be gamma_01 instead of gamma_10."
 Simon Denny posted on Saturday, August 29, 2009 - 3:38 pm
Thanks Linda, a couple of follow-up questions.

1. Why in example in 9.1 do you use Centering = grandmean (x) rather groupmean? I take it that it doesn't really matter in a random intercepts only model. But would groupmean be more appropriate as this is how Mplus decomposes the latent variable (pg 231 users guide).

2. Mplus doesn't produce standardized outputs for variables in model constraint. When I subtract gama01 from gamma10 by hand from the output I get the same as the model constraint estimates. Can I do the same for standardized gamma10 and gama01 output to get standardized contextual coefficients?
 Simon Denny posted on Saturday, August 29, 2009 - 3:48 pm
sorry, just figured out that you can't use GROUPMEAN for variables used in between analyses. But why specify grandmean (x) anyhow?
 Bengt O. Muthen posted on Saturday, August 29, 2009 - 6:31 pm
The Raudenbush-Bryk (2002) page 140 Table 5.11 shows two alternatives, group- and grand-mean centering. As you see there, the grand-mean approach gets you the contextual effect directly as the between-level slope. So here you can use the standardized coefficient directly. As an exercise you can see if you get that by standardizing the subtraction in the group-mean centered alternative.
 Simon Denny posted on Sunday, August 30, 2009 - 2:48 pm
Thanks, that works for the observed covariate group-mean contextual effect.

I guess I was meaning for the second part of example 9.1, why specify grandmean centering for the latent covariate model? As described on page 231 - the latent variable is decomposed as a latent group mean. Hence the need to transform the within and between slopes as in the MODEL CONSTRAINT command.

Is it because Grandmean centering helps the maximum liklihood estimation of the latent group mean?
 Bengt O. Muthen posted on Sunday, August 30, 2009 - 3:09 pm
I don't think that centering is important.
 davide morselli posted on Thursday, August 05, 2010 - 7:08 am
I'm testing a cross level mediation in which a L2 predictor (X) has an effect on a L1 dependent latent variable (Y) via an L1 mediator (m) (it's the type 2-1-1). The dependent variable is a 2-level latent factor specified by three indicators which factor loadings are constrainted to be equal across the 2 levels.
According to Preacher, Zyphur & Zhang (2010), to test the mediation I have to free the variance of the mediator at the to levels. Namely to remove m from the WITHIN list in the VARIABLE specification of my Mplus model.
I was wondering if this mean that I need also to control for the contextual effect of m, as suggested by Ludtke et al (2008) or I simply center it on the grandmean.
 davide morselli posted on Thursday, August 05, 2010 - 10:24 am
In addition to previous post, I'm also trying to calculate the effect size of X on Y, on the basis of Marsh et al (2009).
I am interested in the total size of the effect (direct+indirect).
Using Marsh's indications I wrote the model as following:

DV_W by R1_CNV (2) ;
DV_W by R2_CNV (1) ;
DV_W by R3_CNV (3);

DV ON MV(b_within);

MV (Psi_W);
DV_W (Theta_W);


DV_B by R1_CNV (2) ;
DV_B by R2_CNV (1) ;
DV_B by R3_CNV (3);

DV_B ON IV_B (b1_between);
DV_B ON MV (b2_between);
MV ON IV_B (b3_between);

IV_B (Psi2_B);
CNV_B (Theta_B);
MV (Psi_B);

Model constraint:
IND_EFF = b3_between*b2_between;

!effect sizes
EFFSIZE = (b1_between+IND_EFF)*2*(sqrt(Psi_B + Psi2_B))/sqrt(Psi_W*b_within**2 + Theta_W);

I was wondering if you think the equation for EFFSIZE is correct.
Resulting effect size is .367; I also tried a model without the mediating variable (MV). In that case the effect size results .328

Thank you very much!!

 Linda K. Muthen posted on Thursday, August 05, 2010 - 10:46 am
The MODEL command should be as follows with neither m nor y on the WITHIN list.

y ON m;
y ON m; ! contextual effect
m ON x;

For the second part of your question, please send the full output and your license number to
 Jennifer Yahner posted on Friday, October 01, 2010 - 6:18 am
Dear Dr. Muthen,

Thanks for all your recent help.

I am also trying to estimate a 2-1-1 mediation model.

Are you saying that we should use your more simplified command above instead of the one from Example E of Preacher et al. (2010), which I have written below?

m y;
y ON m;
x m y;
m ON x(a);
y ON m(b);
y ON x;

NEW(indb); !<--Between indirect effect

 Linda K. Muthen posted on Friday, October 01, 2010 - 6:55 am
I was translated what you wrote into the Mplus language. If you want to estimate an indirect effect also, you can use MODEL CONSTRAINT as shown above.
 yin fu posted on Monday, September 12, 2011 - 7:12 am
Dear Dr. Muthen,

I am trying to moderate a contextual effect. I am using a similar syntax code to Marsh et al. 2009. When modeling their model 4 (no random slopes) and their model 5a (random slopes), the contextual effect switches from (significantly) positive to (non-significant) negative in my model.
What could be the reasons for that? The effect stayed similar in the Marsh et al. paper.
Also I am a bit unsure about the "[s] (b_within);" command on the %between% level in Model 5a. Does it say: "the mean of the variance of the slope s on level 2 is called b_within"? Isn't that different to the defining command of (b_within) in model 4?

Thanks for your help, Martin
 Bengt O. Muthen posted on Tuesday, September 13, 2011 - 9:25 am
For your first question it is best if you contact one of the two first authors.

Regarding your second question, the Model 5 statement "[s] (b_within)" says "the mean of the random slope s is given the label b_within". The Model 4 (b_within) is the fixed slope, so the Model 5 label refers to the same thing conceptually, except that in Model 5 the slope also has a variance.
 yin fu posted on Wednesday, September 14, 2011 - 3:43 am
Dear Dr. Muthen,

Thanks for clarifying. I compared my two outputs and the reason for the contextual effect to switch signs is a strongly decreasing Between Level effect.
Is it a normal thing to happen, that the between effect decreases a lot, when a random slope is included in the model, or are chances high that there is something wrong with my data?

Thanks again, Martin
 Bengt O. Muthen posted on Wednesday, September 14, 2011 - 2:13 pm
I think that can happen. See the Raudenbush-Bryk (2002) HLM book.
 Katrin Lintorf posted on Tuesday, May 06, 2014 - 9:02 am
Hello, I would like to test a 2-1-1 mediation hypothesis within a (larger) MSEM. I use the syntax provided by Preacher, Zyphur, & Zhang (2010) and started with a small model consisting only of continuous variables. For this model the MSEM and the UCM produce comparable results. Now I would like to transfer this to a dichotomous mediator and I ask myself how to build analogous models: In the UCM; if I composed the L2-variable of the dichotomous mediator as the mean of this variable, will this be substantially the same as the latent L2-variable in the MSEM? If not: How do I compose a manifest counterpart?

Kind regards
 Bengt O. Muthen posted on Tuesday, May 06, 2014 - 6:48 pm
Q1. Yes.

Q2. Use the CLUSTER_MEAN option
 Katrin Lintorf posted on Thursday, May 08, 2014 - 5:34 am
Thank you for the quick reply. Now I have a follow-up question concerning L1. In the UCM, the covariate x and the mediator m have to be group mean centered on L1. However, in Mplus this is not possible for categorical variables.
(1) How do I disentangle within- and between effects of categorical variables in an UCM in Mplus?
(2) How should I imagine the latent version of my dichotomous L1 variable in a MSEM: Is it substantially comparable to a group mean centered manifest version of the variable? If yes, how can I construct analogous models (UCM - MSEM)?

Kind regards
 Bengt O. Muthen posted on Thursday, May 08, 2014 - 7:54 am
I think you are getting into a methods research area. If you are going to be serious about a binary mediator you have to study up on the issues. For instance, there is a choice of either taking the WLSMV approach of focusing the modeling on the continuous latent response variable underlying the binary observed variable, or taking the counterfactual causal effect approach (but this is not easy with 2-level models). I describe the issues of a binary mediator in my 2011 and 2014 mediation papers (see our website). With the WLSMV approach the mediator is then continuous so binary-specific issues may no longer be present.
 Katrin Lintorf posted on Monday, July 07, 2014 - 10:33 am
Thank you for the advice. Even if the binary mediator were not focal, my dependent variable is also binary. Furthermore, I have missings in my data. Please correct me, but the usual recommendation is to prefer ML over WLSMV in this case. Concerning that I am no statistician I won’t be able to apply the counterfactual causal effect approach on a 2-level-model. So I will try to keep it simple and divide my model in several regressions, following the classical mediation analysis. In doing so I would like to use the Mplus approach which decomposes covariates in two latent parts.

Now I hope that you can give me an advice or a reference as regards this difficulty: I would like to investigate, whether a compositional effect is mediated and I assume that the Mplus approach is analogous to group mean centering of manifest variables. So bc is not calculated (but should be the difference of bb and bw).

(1) How do I calculate the indirect effect in this case and why? I see two options:
(a) Do I first have to calculate the compositional effects for X-M (a) and M-Y (b) and then their product?
(b) Or do I first have to calculate the product of (a) and (b) on both levels and then the difference of the products?
What are the differences in meaning of the two options?
(2) How do I calculate the standard errors for the “right” option?

Thank you for any hints
 Bengt O. Muthen posted on Monday, July 07, 2014 - 4:05 pm
I don't think I know the answers here; seems like it requires methods research.

I assume that you have a model like


extended to a 2-level setting with a W predictor of random effects on level 2. But your M and Y are binary.

With missing data on M or Y I would recommend ML over WLSMV.

Even if Y and M were continuous, I am not sure what you mean. By decomposing covariates I don't know if you mean decomposing X or M or both. You say you are interested in whether a compositional (contextual) effect is mediated - but I don't know if you are referring to a level-2 relationship. Perhaps a path diagram of your intentions would be helpful. On top of this your M and Y are binary and latent variable decompositions are tricky here.
 Katrin Lintorf posted on Tuesday, July 08, 2014 - 2:31 am
I am not sure, whether we think of the same model. Please, let me describe my context of application instead of a path model: We know that after primary school the individual SES explains the choice of a school track but beyond that, the mean SES of the class has additional explanatory value (compositional/contextual effect). Let’s consider a metric mediator: I assume that a higher SES results in higher aspirations which in turn promote the choice of a more demanding school track (Other assumptions contain the binary recommendation for a certain track by the teacher as a mediating variable). The questions are, whether the mediation partially/fully breaks up the direct compositional effect of SES on choice and how large the indirect effect is.

Now I would like to analyze my data by classical mediation analysis, i.e. using several regressions instead of a full path model. I thought of following the second part of ex. 9.1 in the users’s guide. The “implicit, latent group mean centering” led me to the questions in my last posting.

Would you still say that my aim requires further methods research or can you think of some suggestions/solutions as regards my questions?

Thank you for your efforts
 Bengt O. Muthen posted on Wednesday, July 09, 2014 - 10:45 am
Maybe it would help if you show (a simplified version of) the Mplus input for the version of this model where all the variables are continuous.
 Katrin Lintorf posted on Friday, July 11, 2014 - 5:20 am
If all variables were continuous, I specified the following path model:


track_choice ON SES (c1);
track_choice ON Aspiration (b1);
Aspiration ON SES (a1);
SES track_choice Aspiration; !model missingness

track_choice ON SES (c2);
track_choice ON Aspiration (b2);
Aspiration ON SES (a2);
SES track_choice Aspiration; !model missingness

By using MODEL CONSTRAINT I could calculate the direct contextual effect of SES as c2-c1 and the indirect effects as a1*b1 for Level 1 and a2*b2 for Level 2. Now, I am interested in the indirect contextual effect. I see two options:

MODEL CONSTRAINT: !see Q1a in posting above
NEW(indirect context_a context_b);
context_a = a2-a1;
context_b = b2-b1;
indirect = context_a*context_b;

MODEL CONSTRAINT: !see Q1b in posting above
NEW(context indirect_1 indirect_2);
indirect_1 = a1*b1;
indirect_2 = a2*b2;
context = indirect_2 - indirect_1;

My questions:
1) Which option is the right one for my purpose? Do you know any reference?
2) In case of separate regressions I will have to calculate SE and p manually. How do I calculate them for the respective option?

Thank you for any ideas and hints
 Bengt O. Muthen posted on Friday, July 11, 2014 - 5:33 pm
I find page 140 of Raudenbush-Bryk's Second edition helpful where Table 5.11 shows the two alternatives. If you are interested in contextual effects, the right-most alternative gives beta_c directly. That approach would therefore seem to me as the one most useful to expand from regression to the mediation modeling you are interested in. That is, you would focus on the product of slopes on Between. I don't know about references on this specifically. You can still do latent variable decomposition, although I don't see that as essential.

I thought your major question was about switching from continuous to binary variables. In any case that's about all I have to say about this.
 Katrin Lintorf posted on Monday, July 14, 2014 - 10:56 am
I know the mentioned table - and your suggestion (product of slopes after grand-mean-centering) is, what I would have intuitively chosen. Unfortunately, I am not able to give good reasons and I had hoped that you could think of reasons/references to justify the decision.

Nevertheless, thank you for all your efforts and advices.
 Christoph Weber posted on Saturday, July 19, 2014 - 3:51 am
Dear Mplus-Team!
How can I get contextual effects in threelevel models?

I use a simple model:

y ON X (bw);
%between level2%
y ON X (bl2);
%between level3%
y ON X (bl3);

Is the contextual effect of x level2 = bl2 - bw and the contextual effect of x level3 = bl3 - bl2 - bw??
Or is it better to use manifest aggregation of X and use grandmean centering?

 Bengt O. Muthen posted on Saturday, July 19, 2014 - 4:13 pm
Look at the right column of Table 5.11 in the Raudenbush-Bryk book. Not doing group-mean centering gives you the contextual effects on the between levels. The RB book may also discuss this in the 3-level case. So, yes, for simplicity, do manifest aggregation of X and grandmean centering.
 Jan-Henning Ehm posted on Thursday, September 11, 2014 - 4:33 am
Dear Linda/Bengt

I am trying to estimate a contextual effects in a growth model. I have measured reading achievement four times (end of Grade 1, Grade 2, Grade 3 and middle of Grade 4). The following growth model fits the date well.

i s | y1@0 y2@1 y4@2 y4@2.5

On the individual level, intercept and slop are influenced by reading abilities measured at the beginning of Grade 1 (x).

However, I am interested, whether the mean reading abilities of the classes (xm) have an influence (additional to the influence of x) on individual growth in reading.

First, I thought the example on p. 270 in the Mplus User Guide v6 might relates exactly to this question. However, if I understand it correctly the example considers growth on within and between level without cross-level interaction.

Thank you very much for your time
 Bengt O. Muthen posted on Thursday, September 11, 2014 - 12:33 pm
You can add a cross-level interaction, saying for instance


i s | ..........

slopei | i on x;
slopes | s on x;

ib sb | .......

slopei slopes on xm;
 Jan-Henning Ehm posted on Thursday, September 11, 2014 - 1:56 pm
Dear Bengt,

thanks for your answer.
Thus, in the following model

iw sw | y1@0 y2@1 y4@2 y4@2.5;

iw sw on x;

ib sb | y1@0 y2@1 y4@2 y4@2.5;

ib sb on xm;

the effect of xm (aggregated variable) on ib and sb is over and above their effect at the within level?

 Bengt O. Muthen posted on Thursday, September 11, 2014 - 2:19 pm
That's right.
 zahra sharafi posted on Tuesday, September 23, 2014 - 10:31 pm
Dear Drs. Muthen,
I want to simulate ordinal multilevel data that has DIF. I just know I should use 2 parameter logistic IRT model. Please tell information about this model and steps of my simulation. I have a little information about this problem and I do not know where I can find about it?
 Bengt O. Muthen posted on Wednesday, September 24, 2014 - 2:19 pm
IRT modeling in Mplus is described on our IRT page which you find in the left margin of our homepage.

But you need to learn about the topic before you can start doing simulations. You will find many references using Google. And you can ask on a general discussion forum like SEMNET.
 Dirk Pelt posted on Tuesday, September 29, 2015 - 2:35 am
I have a similar question as Student 09 and Simon Denny in 2009:

When grandmean centering is used, gamma10 should already be the contextual effect, right? (according to R&B, table 5.11, p. 140).

So why is the betac = gamma01 - gamma10 command there in example ex9.1b?

I noticed that in the Marsh et al (2009) paper, the same is done (Model 4). Then, in Model 5, the centering is removed, while the contextual effect is calculated in the same way (gamma01 - gamma10).

So my question is basically: what is the correct way of calculating the contextual effect when using a grand mean centered X (or raw X, corresponds to raw X - 0)?


 Bengt O. Muthen posted on Wednesday, September 30, 2015 - 4:43 pm
Note that ex 9.1b uses a latent variable decomposition of x. As it says on page 263 of the UG, this means that Mplus uses a "latent group-mean centering of the latent within-level covariate". Hence, the betac expression.
 Dirk Pelt posted on Thursday, October 01, 2015 - 4:37 am
Thanks for your answer. However, when I compare results from the two different methods of example 9.1., it appears that this betac expression is not needed.

With my data, using the first method with grandmeancentering, the between effect (Mx) on y is .16 (contextual effect), the within effect is .35. Using the second method produces identical results.

Hence, if I had used the betac expression in the 2nd method (latent decompositon of X), the conclusion would have been that the contextual effect would be .16 - .35 = -.18.

As a check, I compared the results using groupmean centering: the latent between effect is then .51 and the within effect is .35. The contextual effect being .51 - .35 = .16. Again, this speaks against using the betac calculation when using grand mean centering.

Why should adding a latent between component of X change calculations of the contextual effect? Assuming perfect reliability of Mx (as is almost the case in my data), shouldn't the results be the same? I hope you can clear my confusion.
 Bengt O. Muthen posted on Thursday, October 01, 2015 - 3:10 pm
Note that in the latent, implicit group-mean centering

x_w = x - x_b

so a change in contextual effects between observed and latent variable treatment of x on between is not exactly dependent on reliability of the covariate, but more on the between variance.

To get clarity in your comparisons, please send the 2 outputs from the analyses of your data corresponding to the 2 approaches of ex 9.1.a and 9.1.b to support along with your license number.
 Tino Nsenene posted on Tuesday, October 13, 2015 - 8:02 am
Hello Prof. Muthen,

you write

"a change in contextual effects between observed and latent variable treatment of x on between is not exactly dependent on reliability of the covariate, but more on the between variance."

Is there any literature available discussing this point? Why is it the variance, and not so much the absence of sampling error? I'd like to learn more about why and when contextual effects change -

 Bengt O. Muthen posted on Wednesday, October 14, 2015 - 2:23 pm
Have a look at the article on our web site

Lüdtke, O., Marsh, H.W., Robitzsch, A., Trautwein, U., Asparouhov, T., & Muthén, B. (2008). The multilevel latent covariate model: A new, more reliable approach to group-level effects in contextual studies. Psychological Methods, 13, 203-229.
download paper contact first author show abstract
 Sara Geven posted on Friday, February 05, 2016 - 7:08 am
Hi all,

I have data on children in different academic tracks. As part of the study, I would like to test whether equally able peers have a lower academic self-view in higher ability tracks.

On the within level I measure individual ability level by test scores. The academic track of students is purely a classroom variable (does not differ between students in a class).

Can I apply the contextual effect calculation here as well?
More specifically, is it correct to substract the between-level track effect on academic self-concept from the within level effect of academic ability on self-concept.

Thank you in advance!

Sara Geven
 Bengt O. Muthen posted on Friday, February 05, 2016 - 5:55 pm
See the text of UG ex 9.1 and also Table 5.11 in the Raudenbush-Bryk multilevel book.
 Sara Geven posted on Monday, February 08, 2016 - 3:05 am
Dear Prof Muthen,

I looked at the examples. Yet, in example 9.1 the x at the between level and the x at the within level are the same variables with the same metric. I am wondering whether it is appropriate to subtract a within level effect from a between-level effect when the x's at the different levels are different variables (i.e. ability test score versus ability track). I do control for the ability test score at the between level of course.

 Bengt O. Muthen posted on Monday, February 08, 2016 - 1:40 pm
You may want to ask that question on Multilevelnet.
 Michael Sciffer posted on Tuesday, July 03, 2018 - 5:22 pm
Hi Dr Muthen

Is there a way of using the latent contextual effect (Raudenbush & Bryk, 2002) as shown in Ex 9.1 from Model constraint in further analysis, such as an interaction effect or is this only possible with a manifest contextual variable?

In other words, I don't want to test whether a between group effect interacts with another variable, but whether the contextual effect interacts with another variable.
 Bengt O. Muthen posted on Tuesday, July 03, 2018 - 5:38 pm
I think you are referring to xbj in ex 9.1. This latent variable can interact with other variables and it and its interactions can be predictors of other variables.
 Michael Sciffer posted on Tuesday, July 03, 2018 - 7:26 pm
Sorry, no I was referring to the parameter labelled 'betac' in the Model Constraint section, that is, xbj - xwij.
 Bengt O. Muthen posted on Wednesday, July 04, 2018 - 4:27 pm
betac is not equal to xbj - xwij but is a coefficient, that is, a value, not a variable. It needs to be a variable to interact with other variables. It could be random (and therefore a variable) if you have yet another Between level.
 Christoph Weber posted on Thursday, March 07, 2019 - 3:50 pm
Dear Dr. Muthén, I just read the latent centering paper in the SEM Journal. I'm espacially interested in the probit example. You use r(Ybj,Xbj) to evaluate the quality of estimation. But r is pure Level 2 estimate, isn't it (because it's solely based on L2-paramters)? So I'm wondering how to define/estimate the contextual effect. Why don't you use (b2 - b1), just like in the linear case, and use this for the calculation of r?
 Tihomir Asparouhov posted on Friday, March 08, 2019 - 2:18 pm
We preferred r(Ybj,Xbj) as it is scale and model parameters independent, which gives sort of a universal indicator of quality. For example you can compare Table 8 and 9 even though they are very different. I think the earlier version of the paper might have had also the uncentered method there which makes the comparison a bit trickier across the methods (but not if you use the correlation). r(Ybj,Xbj) is not pure Level 2 estimate in the context of centering methods comparison as the levels get intertwined. Anyway, the call for which comparison to use was purely subjective. You can easily evaluate b2 - b1 using our scripts
 Christoph Weber posted on Friday, March 08, 2019 - 2:50 pm
Thanks, I get it. Regarding the Level 2 estimate. What I meant is that r corresponds to b_between of the linear case for latent mean or Group mean centering and of course covers Level 1 and 2 effects. Is this correct?

One further Question: I'm interested in a model with a binary predictor and a binary Outcome. In this case, what would be a suitable effect size estimate for the contextual effect? Is it possible to use r as an ES (and use b2-b1 instead of b2)? Or could effects size estimates as used in several Marsh, Lüdtke papers also be applied to probit models with residual variance = 1 on L1?
 Tihomir Asparouhov posted on Friday, March 08, 2019 - 4:14 pm
Formula (64) shows that r depends only on between level parameters. When observed centering is used, however, the biases show up in multiple places b1, b2, sigmas, etc. see Table 3 and 4, not just in b2-b1. What I meant that the levels are intertwined is that an error in Xb results in an error in Xw since Xw = X-Xb.

I think effects size estimates could be used as in Marsh and Lüdtke. For the contextual effect size (between level relationship) you don't fix anything to 1 so the logic and the interpretations should be very similar I think.
 Christoph Weber posted on Saturday, March 09, 2019 - 12:01 pm
Thanks for the clarification.
Regarding ES: What I meant is, that if ES = 2*b_b*SD(pred_b)/SD(outcomeL1), than SD(outcomeL1) = square root(b_w*b_w*var_w + e) and e = 1 in the probit model. A'm I right?
 Tihomir Asparouhov posted on Monday, March 11, 2019 - 9:19 am
I think it is not quite correct. SD(outcomeL1) should be including the between level variance as well. See formula (13) in
with b2=0.

These formulas were developed for the continuous variables. They can be used for categorical as well with the Y* interpretation but there probably is a better way to evaluate the standardized BFLP effect for categorical variables. You might want to contact Marsh and Lüdtke to see their take on this.

You might also find useful section 8.4 in
which also discusses the mediator option in Mplus.
 Christoph Weber posted on Monday, March 11, 2019 - 2:31 pm
Thanks for the valueable hints.
Regarding the formula. There are several versions of the ES. Tymms (2004, p. 62) proposes the residual L1 SD of the outcome (after controls). Marsh et al. (2009, p. ) extend ES by "operationalizing effect size in relation to the total variance of the L1-ASC rather than its residual" (ES2). Further, they also use the total SD (as you proposed; ES3). In subsequent papers of Marsh et al. only ES2 (SD at L1) was used (e.g. Morin et al., 2014). In the Wang (2015) paper ES3 is used. Do you have any references, what would be the "best" ES for the continuous case?
 Tihomir Asparouhov posted on Tuesday, March 12, 2019 - 12:56 pm
I don't but the two version are just multiples of each other with the multiplication factor sqrt(ICC).
 Christoph Weber posted on Tuesday, March 19, 2019 - 3:53 pm
Dear Mplus-Team, a follow up question.
I'm doing a simulation for contextual effects with binary X and Y. I'm wondering how to specify the threshold for Y which is conditional on X. This seems easy when X is continous, but how is this done with a threshold on a probit scale (similar to your binary predictor model in the latent centering paper).

I use the following model on L2.

P(y=1|X) = F(a + b1*X)
P(x=1) = F(ax)
ax = 1.64 (--> x = 1 approx. 5%)
b1 = 0.59
How to solve this for Y = 1 approx. 5%?
 Tihomir Asparouhov posted on Wednesday, March 20, 2019 - 9:31 am
It would be easier if you generate the data from a bivariate two-level probit model (which is the same model).

x with y;
x with y; x; y;
[y$1 x$1];

this is a simple and equivalent reparameterization of

y on x;
y on x;
[y$1 x$1];

Both for X and Y you can control the probability the same way

P(Y=0)=Phi(threshold/sqrt(1+between variance))
 Christoph Weber posted on Thursday, March 21, 2019 - 4:53 pm
Thanks a lot, finally I want to include a countinous variable X in a mediation model X -> M --> Y, where M and Y are binary variables. Is your suggestion also suitable for such a model?
 Tihomir Asparouhov posted on Thursday, March 21, 2019 - 6:15 pm
Sure. If it gets too complex of a model to work out the math you can just do trail and error with the parameters until you get to your desired levels of outcome proportions.
 Michael Sciffer posted on Sunday, April 14, 2019 - 1:11 pm
When modelling contextual effects in two-level regression models where the contextual effect is the group average of an individual-level indicator, such as SES, group-mean centering and grand-mean centering provide equivalent estimates, that is, in the group-mean centered model, context = between-within, whereas the grand-mean centered model provides a direct estimate of the contextual effect.
But I have found that when applying Marsh et al. (2009) latent-manifest method to a 3-indicator measure of SES (from the PISA dataset) the grandmean centered model provides a larger standardized coefficient for the contextual effect than the coefficient derived from the group-mean model.
I am wondering why this is the case?
 Bengt O. Muthen posted on Monday, April 15, 2019 - 4:24 pm
I am not familiar with the "latent-manifest" method. When Mplus does a latent variable decomposition of a predictor, latent group-mean centering is done. A good discussion is given in the paper on our website:

Asparouhov, T. & Muthén, B. (2018). Latent variable centering of predictors and mediators in multilevel and time-series models. Structural Equation Modeling: A Multidisciplinary Journal, DOI: 10.1080/10705511.2018.1511375 (Download scripts).
 Tsz Tan Lau posted on Tuesday, October 15, 2019 - 1:07 pm
Hi Drs Muthén,

I am doing a doubly latent model in Marsh (2009). The variable pv are plausible values processed by TYPE = IMPUTATION, all variables are standardized:

aw by a1 (1);
aw by a4 (4);
pv on aw (b_w);
pv (theta_w);
aw (psi_w);

%between b1%
ab1 by a1 (1);
ab1 by a4 (4);
pv on ab1 (b_b1);
pv (theta_b1);
ab1 (psi_b1);
pv on conf;
ab1 on conf;

%between b2%
ab2 by a1 (1);
ab2 by a4 (4);
pv on ab2 (b_b2);
pv (theta_b2);
ab2 (psi_b2);

new(cwt); cwt = b_b1 - b_w;
new(cct); cct = b_b2 - b_b1;
new(scef1); scef1 = cwt*(sqrt(psi_b1))
/sqrt(psi_b1*b_b1**2+theta_b1 + psi_b2*b_b2**2+theta_b2+psi_w*b_w**2+theta_w));
new(scef2); scef2 = cct*(sqrt(psi_b2)
/sqrt(psi_b1*b_b1**2+theta_b1 + psi_b2*b_b2**2+theta_b2+psi_w*b_w**2+theta_w));

1 Is it right to calculate the lv3 unstandardized contextual effect as b_b2 – b_b1 or b_b2 – b_w?
2 For path pv on conf and ab1 on conf, do I need to calculate standardized coefficients like the contextual effects?
 Tihomir Asparouhov posted on Wednesday, October 16, 2019 - 9:26 am
1. b_b2 – b_w
2. I don't think so
 anonymous posted on Thursday, November 21, 2019 - 2:09 pm
If the MPLUS prints a contextual effect directly at the class level (grand-mean), can I report the standardized effect directly from the output.
 Bengt O. Muthen posted on Thursday, November 21, 2019 - 5:26 pm
If you set up the analysis like in the right column of Table 5.11 in Raudenbush & Bryk (2002), yes then you get the standardized contextual effect straight from the outpout.
 anonymous posted on Saturday, November 23, 2019 - 7:35 am
Thank you very much!
Back to top
Add Your Message Here
Username: Posting Information:
This is a private posting area. Only registered users and moderators may post messages here.
Options: Enable HTML code in message
Automatically activate URLs in message