Total and Indirect Effects PreviousNext
Mplus Discussion > Multilevel Data/Complex Sample >
Message/Author
 Barbara Mark posted on Friday, April 07, 2000 - 11:30 am
In a multi-level SEM, can the coefficients from the StdYX column on the MPlus outut be used to calculate total and indirect effects, in an analogous manner to a path model?
 bmuthen@ucla.edu posted on Saturday, April 08, 2000 - 8:52 am
The StdYX coefficients for the between- and for the within-part of the model can be used just as in a single-level model.
 Anonymous posted on Monday, September 24, 2001 - 2:19 pm
How do you then calculate the significance of the indirect effects?
 Linda K. Muthen posted on Monday, September 24, 2001 - 5:37 pm
You would need to calculate the standard error for each indirect effect using the delta method.
 Linda Trudeau posted on Tuesday, October 30, 2001 - 10:37 am
How do I find instructions for the delta method?
 Linda K. Muthen posted on Tuesday, October 30, 2001 - 1:22 pm
I believe that this is discussed in Ken Bollen's book, Structural Equations With Latent Variables, beginning on page 390.
 Allison Tracy posted on Monday, July 12, 2004 - 8:53 am
Is it possible to request indirect effects by using the MODEL INDIRECT command for two-level models in version 3?
 Linda K. Muthen posted on Monday, July 12, 2004 - 9:01 am
No, indirect effects are not available for multilevel models.
 Mary posted on Friday, December 02, 2005 - 1:02 am
I'm working on Mplus, doing multi-level SEM with non-recursive. I want the indirect effects and total effects to be shown in the results. Is it possible? and how?
Thank you
 Linda K. Muthen posted on Friday, December 02, 2005 - 6:03 am
MODEL INDIRECT is not yet available for TYPE=TWOLEVEL. You would need to calculate the indirect and total effects by hand.
 Keith posted on Monday, December 12, 2005 - 12:10 pm
Is MODEL INDIRECT available under type=complex?
 Linda K. Muthen posted on Monday, December 12, 2005 - 2:48 pm
Yes.
 xixi posted on Friday, January 06, 2006 - 8:48 am
Does it mean that we can't use multilevel model to test mediating effect?

I want to test the mediating effect of "satis" on the relationship between "ijc" and "retain".

The following are my command syntax:

DATA: File is D:\prepare for proposal\zp data test\mplus\test3.dat;

Variable: Names are group
satis
ijc
retain;
Usevariables are group-retain;
Between = ijc;
cluster is group;

ANALYSIS: Type = twolevel;

MODEL:
%WITHIN%
retain on satis;
%BETWEEN%
retain on ijc;
satis on ijc;

And the error message is:
*** ERROR in Model command
Variable is a y-variable on the BETWEEN level but is an x-variable
on the WITHIN level: SATIS

How do I deal with this situation? Thanks!
 Linda K. Muthen posted on Friday, January 06, 2006 - 11:29 am
I think you may not be using the most recent version of Mplus, Version 3.13. If you are not, I would download it and try this model again. If you are, then please send your input, data, output, and license number to support@statmodel.com.
 student07 posted on Wednesday, August 15, 2007 - 9:06 am
Hi Drs. Muthén!
is it possible to request indirect effects by using the MODEL INDIRECT command for two-level models in version 4.1? (At least I get some output - I only wonder whether this can be used?)

Thank you!
 Linda K. Muthen posted on Wednesday, August 15, 2007 - 10:14 am
Yes as long as numerical integration is not required.
 Lucy Barnard posted on Saturday, October 06, 2007 - 1:31 pm
Linda,

Is it possible to calculate indirect effects using Type = Twolevel in Mplus 4.2? If not, is there an article or book you would recommend on how to calculate indirect effects for multilevel models?

Thanks,

Lucy
 Linda K. Muthen posted on Saturday, October 06, 2007 - 4:04 pm
Yes, see MODEL INDIRECT.
 Fernando Terrés de Ercilla posted on Tuesday, October 09, 2007 - 9:08 am
I have a multilevel SEM:
Model:
%Within%
lbtog ON ltpcat t;
liit ON lbtog ltpcom t;
%Between%
lbtog ON crectb04 tinact apertura intxaper;
liit ON crectb04 tinact apertura intxaper;
lbtog With liit;
And I am interested in testing the indirect effect:
Model indirect:
liit IND ltpcat;

My question is related to the possibility of getting bootstrap standard errors. I know that the bootstrap is not available in this situation, do you know of any other means to make this kind of analysis?
Thanks in advance,
Fernando.
 Linda K. Muthen posted on Tuesday, October 09, 2007 - 9:10 am
I don't know of any way to obtain bootstrapped standard errors with TYPE=TWOLEVEL in Mplus.
 Benjamin Boecking posted on Friday, August 15, 2008 - 7:19 am
Dear Dres Muthen,

I am a psychologist (not a statistician) who is currently dealing with a nice (yet complex) dataset regarding a randomized clinical trial with up to 14 weekly measurement timepoints.

Putative mediators and outcome were both collected weekly (total: up to 14 sessions)

My main interest is to detect whether - overall - the putative mediators at timepoint X mediate symptom change for timepoint X+1.

I am not sure whether to use a multilevel model (repeated measures nested within persons) and if yes, which type (multilevel? or complex?).

Another problem is that the n is only 29 so there's not much power there to detect any effects...
maybe i should try a growth model instead (change in mediators predicting change in symptoms with a timelag of one session?)

any help would be appreciated.

Best and thank you!
Benjamin
 Linda K. Muthen posted on Friday, August 15, 2008 - 8:22 am
I would use a growth model as shown in the examples in Chapter 6 of the user's guide. How you include your mediators depends on your research hypotheses.
 Benjamin Boecking posted on Friday, August 22, 2008 - 7:36 am
Dear Linda,

I would likt to show that changes in my mediator precede changes in outcome by a lag of one session.
That is I am trying to model two growth curves: one for the outcome and one for the mediator. I am then trying to predict the slope of the outcome growth curve with a "t - 1 time-lagged" curve of the mediator...naturally, I am not quite sure how to set up the model, especially as my model fit is not so good (i s | for outcome: CFI 0.599, TLI 0.635; for mediator: CFI 0.519, TLI 0.562).

Many thanks
Benjamin
 Linda K. Muthen posted on Friday, August 22, 2008 - 8:27 am
Instead of having a growth curve for the mediator, you would use it as a time-varying covariate and lag it. I think Example 6.12 is close to what you want. You should get a good-fitting growth model for your outcome as a first step.
 Lotta Tynkkynen posted on Wednesday, October 15, 2008 - 5:09 am
Hello!

I would like to test a moderation effect on between-level. Interaction between moderator (3-level categorical) and independent variable is not significant, but if I do a multigroup analysis based on the moderator I find that the association between the independent variable and dependent variable is clearly significant in one of the groups but not in two others. Do you think this proves for moderation (after testing that the differences between groups are significant) or do you have some other ideas?

Thank you very much!

Lotta
 Linda K. Muthen posted on Wednesday, October 15, 2008 - 10:13 am
I would need to see the two full outputs to fully understand what you are saying. Please send them and your license number to support@statmodel.com.
 Guillaume Fürst posted on Monday, June 22, 2009 - 2:48 am
Hello,

my question is about p-values of indirect effect.

I have a model of this type:
X -> M -> Y

in which both simple effects are significant:
X -> M : estimate = -0.651, p = 0.018
M -> Y : estimate = 0.073, p = 0.020

However, the indirect effet (-0.651*0.073 =0.048) is not significant (p=0.098), and I have trouble understanding this.

My question is perhaps naive, but could you please explain to me why the p-value of the indirect effect is not significant here, while the simple effects are both significant?

Thanks,
Guillaume.
 Linda K. Muthen posted on Monday, June 22, 2009 - 8:55 am
This can happen. The two regression coefficients may be positively correlated causing the denominator of the z-test to be large. You can see this is TECH3.
 Guillaume Fürst posted on Wednesday, June 24, 2009 - 2:17 am
OK. Thank you for your answer.
Could you just tell me where I can find the complete formula of this t-test?
Best regards,
Guillaume
 Bengt O. Muthen posted on Wednesday, June 24, 2009 - 8:52 am
Please see the Bollen SEM book.
 Miranda Vervoort posted on Monday, May 03, 2010 - 2:27 am
Good morning,
Hopefully you can help me with the problems I have.
I have data of 1670 immigrants in 720 neighbourhoods. I am interested in effects of neighbourhood composition (= between level) on majority language proficiency (= individual level).
I am especially interested in the mediating role of social contacts (= individual level).

Thus:
neighbourhood composition -> contacts
-> language proficiency.

Language proficiency is categorical.

1) If I try to estimate it with multilevel, I cannot specify the contacts as 'within' because I have to include the the neighbourhood composition -> contacts.
But if I do not specify it as within, I get the warning : Unrestricted x-variables in TWOLEVEL analysis with ALGORITHM=INTEGRATION must be specified as either a WITHIN or BETWEEN variable.
I guess that is because I have a categorical dependent variable. Is there a way to solve this?

2) If I try to estimate it with TYPE=COMPLEX with neighbourhood as cluster, I can estimate the direct and indirect effects. But is this the best way? The fit indices I get are CFI .819, RMSEA .057, I think this is not good?
Moreover, my contact measures are negatively correlated at the between level, but positively correlated at the individual leve. Can I take that into account with TYPE=COMPLEX?

I hope you can give me advice! Thank you!
 Bengt O. Muthen posted on Monday, May 03, 2010 - 7:33 am
You will find a solution in UG ex 9.4 which uses weighted least squares estimation.
 Sofie Wouters posted on Tuesday, July 13, 2010 - 5:43 am
Is it possible to do bootstrapping with type=complex in the new Mplus version 6 to check for mediation?
Thank you for your answer!
 Linda K. Muthen posted on Tuesday, July 13, 2010 - 6:12 am
No.
 Roos Hutteman posted on Thursday, October 28, 2010 - 7:06 am
Dear Drs. Muthén,

I am trying to estimate a multi-level SEM with indirect effects (in Mplus version 4.0). My data are nested (children within schools) so I am using a two level design, but as I have no predictors on the school level, I am only specifying a within model. The problem is the MODEL INDIRECT command, as soon as I add this to the model, it doesn't run anymore. Here is my input and error message:

MODEL: %WITHIN%
ws BY w_s1* w_s2 w_s3;
…….

nb2 ON ws wn wh wtv nb1;
agg2 ON nb2 ws wn wh wtv agg1;

agg1@1;
….

MODEL INDIRECT: %WITHIN%
agg2 IND nb2 ws;
agg2 IND nb2 wn;
agg2 IND nb2 wh;
agg2 IND nb2 wtv;
agg2 IND nb2 nb1;

OUTPUT: TECH1 TECH4 TECH8 SAMPSTAT STAND CINTERVAL;

*** ERROR
No valid keyword specified.

(for full input see: http://pastie.org/private/vt5vw78zqnnlnnx63th2a )

I hope you can give me advice. Thank you in advance!

Best,

Roos
 Linda K. Muthen posted on Thursday, October 28, 2010 - 10:28 am
You are not using MODEL INDIRECT correctly. %WITHIN% is not part of it. See the user's guide under MODEL INDIRECT and Example 3.16 to see the correct specification for MODEL INDIRECT.
 Patchara Popaitoon posted on Thursday, March 17, 2011 - 2:49 pm
Hi,

I am not sure what's wrong with the model command for indirect effect. Below is my model command and I got this error message: *** ERROR in MODEL INDIRECT command Statements in MODEL INDIRECT must include the keyword IND or VIA. No valid keyword specified. Please advise. Thanks.

Model Indirect:
AOC IND POS A1;
AOC IND POS A2;
AOC IND POS M1;
AOC IND POS M2;
AOC IND POS O1;
AOC IND POS O2;
AOC IND POS LMX;
 Linda K. Muthen posted on Thursday, March 17, 2011 - 2:53 pm
I would need to see the full output to understand why this message appears. Please send it and your license number to support@statmodel.com.
 patrick sturgis posted on Wednesday, January 25, 2012 - 2:35 am
I have a 2-level model with no latent variables. I am specifying an indirect effect of a level 2 variable through a second level 2 variable on the level 1 outcome. Everything works fine and I obtain indirect effect estimates and standard errors. However, I do not get any direct or total effect estimates in the output. I am specifying it thus:

%BETWEEN%
y on x1 x2;
x1 on x2;
MODEL INDIRECT:
yIND x1 x2;

any suggestions? thank you,

Patrick
 Linda K. Muthen posted on Wednesday, January 25, 2012 - 11:31 am
I believe you get those using VIA when there is more than one way to get from x2 to y. There is only one in your model.
 kirsten way posted on Thursday, February 09, 2012 - 5:44 pm
Hello,

Is it possible to do bootstrapping with type is two level random in the new Mplus version 6 to check for mediation?
Thank you for your answer!
 Linda K. Muthen posted on Friday, February 10, 2012 - 6:39 am
No, this is not currently possible.
 Ute Hulsheger posted on Monday, February 13, 2012 - 7:20 am
I have diary data (about 200 individuals reporting data on 5 workdays) and would like to predict a day-level outcome (EE2) from a day-level state variable(Md) and a day-level mediator (SAd). As a model I used the 1-1-1 MSEM fixed slopes model described by Preacher et al., (2010). As control variables, I wanted to include a level-1 lag variable EE2b representing the dependant variable EE2 on the previous day (EE2b). Doing so yields unplausibel results (compared to what I get when doing a similar model in R) and an Mplus error messages.
My code was.

...
USEVARIABLES = id EE2 EE2b SAd Md;
MISSING ARE ALL (-99);
CLUSTER IS id;
CENTERING = GRANDMEAN (SAd EE2b Md);

ANALYSIS:
TYPE IS TWOLEVEL RANDOM;

MODEL:
%WITHIN%
SAd ON Md(aw);
EE2 ON SAd(bw);
EE2 ON EE2b Md;

%BETWEEN%
Md SAd EE2;
SAd ON Md(ab);
EE2 ON SAd(bb);
EE2 ON EE2b Md;

MODEL CONSTRAINT:
NEW(indb indw);
indw=aw*bw;
indb=ab*bb;
It would be great if you could give me some advice.
Thanks in advance
Ute
 Linda K. Muthen posted on Monday, February 13, 2012 - 7:30 am
Please send the output and your license number to support@statmodel.com and explain what about the results is implausible.
 Patchara Popaitoon posted on Sunday, April 22, 2012 - 12:07 pm
Dear Linda,

I am aware that MODEL INDIRECT is not yet available for TYPE=TWOLEVEL. But, I need to report the indirect effects in the paper. I would like to know how to calculate the indirect effects by hand. Many thanks.
Pat
 Patchara Popaitoon posted on Sunday, April 22, 2012 - 12:12 pm
Dear Linda,

In relations to previous, all variables are continuous variables. Thanks.

Pat
 Linda K. Muthen posted on Sunday, April 22, 2012 - 2:19 pm
MODEL INDIRECT is available with TYPE=TWOELEVEL. Indirect effects with all continuous variables are the product between the regression coefficients involved in the indirect effects.
 Patchara Popaitoon posted on Sunday, April 22, 2012 - 2:48 pm
Dear Linda,

Sorry I didn't make it clear. I can't request for the indirect effect from within to between level variables from the multilevel analysis with TYPE = TWOLEVEL. Can I calculate the regression coefficients involved in these indirect effects as advised? Thanks.
Pat
 Patchara Popaitoon posted on Monday, April 23, 2012 - 2:47 am
Also, please could you advise how to calculate the significance level of the indirect effects? Thanks.
Pat
 Linda K. Muthen posted on Monday, April 23, 2012 - 12:42 pm
You can't have an indirect effect that uses one within coefficient and one between coefficient. You can on between regress the between part of the individual-level variable on a between-level covariate.
 Patchara Popaitoon posted on Monday, April 23, 2012 - 2:45 pm
Are you suggesting that it is invalid to calculate the cross level indirect effect even by hand or that Mplus does not provide this feature in TWOLEVEL analysis type?

I have seen some published papers used Sobel test to examine the significance level of the mediating effect. These papers studied cross-level effect from group level predictors to individual level outcomes.

My study is also testing a cross-level effect, but from individual level predictors to group level outcomes. Do you think that I can use Sobel test to examine the significance level of the mediating effect for my case?

Thanks.
Pat
 Bengt O. Muthen posted on Monday, April 23, 2012 - 3:03 pm
The way to have an effect from a variable Y observed for individuals on a group-level outcome W is to have the group-level part of Y have an effect on W on level-2. That's what Linda is saying. This is not a restriction particular to Mplus.

Quoting you:

"These papers studied cross-level effect from group level predictors to individual level outcomes."
That is talking about W having an effect on the group-level part of Y (not the other way around), and thereby influencing the variable observed for the individual.
 Paraskevas Petrou posted on Thursday, September 27, 2012 - 8:43 am
Hai,

I test a multilevel mediated moderation model in Mplus. Actually my moderation affects an indirect and not mediating effect (because the interaction term relates to the mediator but not to the outcome). Below my model and questions:

At both levels of analysis, IVs are: com, pre, pro, preXcom & proXcom. Mediators are: jc1, jc2 & jc3. Outcomes are: we & adapt. The indirect/mediating processes I’m interested in are: 1. pro to we (via jc1, jc2, jc3) 2. pro to adapt (via jc1, jc2, jc3) 3. preXcom to we (via jc1, jc2, jc3) 4. preXcom to adapt (via jc1, jc2, jc3). Pro is expected to relate to we & adapt, therefore, I assume processes 1 and 2 refer to mediation. preXcom is not expected to relate to we or adapt, therefore, I assume processes 3 and 4 refer to indirect effect. I know that Bootstrap is not available in a two-level model, but I want to show to the reviewers that I take into account mediation/indirect effects in my paper.

i. Can I follow the 4 steps of Baron & Kenny and conduct Sobel tests to test processes 1 and 2?
ii. If I ask for indirect effects through the IND command for the processes 3 and 4, is this enough, or is it inadequate when there is not a Bootstrap next to it?
iii. For the processes 1 and 2, I can also ask for indirect effects through IND in Mplus. Would that be preferable compared to Sobel?

Thank you very much in advance.
Paris
 Linda K. Muthen posted on Friday, September 28, 2012 - 9:57 am
Because you cannot use the BOOTSTRAP option with TWOELEVEL, I would suggest ESTIMATOR=BAYES.
 Stefanie App posted on Monday, March 18, 2013 - 10:07 am
Hi,
I want to analyze if three latent varialbes mediate (F2, F3, F4) the effect between variable F1 and F5 by using the bootstrap technique. Therefore I have used the model indirect option (F5 IND F1), but the output never shows all three as mediators.
What could I be doing wrong? Or ist it not possible to have three mediators?
Thank you very much!
 Linda K. Muthen posted on Monday, March 18, 2013 - 1:32 pm
Please send the output and your license number to support@statmodel.com.
 Cecily Na posted on Saturday, April 06, 2013 - 9:48 am
Hello Linda,
I have an SEM where the indirect path coefficients from A to B are positive, but the direct effect from A to B is negative. What's the command for me to get the total effect? Does it mean that my model has some problems?
Thanks!
 Linda K. Muthen posted on Saturday, April 06, 2013 - 5:24 pm
The total effect is obtain by using an IND statement with one variable on the left-hand side and one on the right-hand side. See the user's guide.
 anne C posted on Monday, August 26, 2013 - 4:47 am
Hello,

I am running a mediation analysis using TYPE=Complex because of the structure of my data.
I obtain
a significantly positive direct effect c': Y-> X,
a significantly positive "a" path: Y->M,
a significantly negative "b": M->X.

when I run the same analysis on M->X only (ignoring Y) I get positive non significant coefficient.

Is it correct to conclude that "the effect of Y->X is positive" while the effect of M->X, not due to Y, is negative?

Thanks in advance
 Linda K. Muthen posted on Monday, August 26, 2013 - 11:31 am
Please send the two outputs and your license number to support@statmodel.com.
 Maria Varela posted on Tuesday, October 15, 2013 - 10:03 am
Hi, I am starting with MPlus6. I want to calculate a multilevel moderated mediation model. Mediation is 2-1-1. Moderation is in the m-y relation. I want to incorporate L2 (c21,c22) and L1 (c11-c13) control var. Input:
Between are x c21 c22;
Define: mz = m * z;
Analysis: Type = twolevel;
Model:
%WITHIN%
y m z mz;
y ON m (g1)
z (g3)
mz (g2)
c11
c12
c13;
%BETWEEN%
y x m z mz;
m ON x (b)
c11
c12
c13
c21
c22;
y ON m (g1)
z (g3)
mz (g2)
c11
c12
c13
c21
c22;
MODEL CONSTRAINT:
NEW (indirect mod);
mod= -1,1;
indirect = b*(g1+g2*mod);
OUTPUT: CINTERVAL;

Warning: In the MODEL command, the following variable is a y-variable on the BETWEEN level and an x-variable on the WITHIN level. This variable will be treated as a y-variable on both levels: m
THE MODEL ESTIMATION DID NOT TERMINATE NORMALLY DUE TO AN ILL-CONDITIONED FISHER INFORMATION MATRIX.
THE MODEL ESTIMATION DID NOT TERMINATE NORMALLY DUE TO A NON-POSITIVE DEFINITE FISHER INFORMATION MATRIX. THE CONDITION NUMBER IS -0.233D-16.
THE STANDARD ERRORS OF THE MODEL PARAMETER ESTIMATES COULD NOT BE COMPUTED. PROBLEM INVOLVING PARAMETER 26.

What could I be doing wrong? Thanks.
 Linda K. Muthen posted on Tuesday, October 15, 2013 - 10:38 am
Please send the output and your license number to support@statmodel.com.
 Paraskevas Petrou posted on Friday, December 13, 2013 - 1:08 am
Hi,

I am testing a multiple mediation model: x1, x2 (predictors); m1, m2, m3 (mediators) and y1, y2 (outcomes). Every variable has been measured twice. The two measures are nested within persons, resulting in a multilevel mediation. I'm testing this model and getting results both at the between and at the within level. This model is essentially cross-sectional. But is there a way to restructure my dataset in such a way that any path from x or m variables to y variables is lagged? So all x/m --> y paths are longitudinal (T1 to T2) but not the x --> m paths?

Thank you in advance!
Paris
 Linda K. Muthen posted on Friday, December 13, 2013 - 10:13 am
I would put my data in the wide format and not use multilevel modeling. Let the multivariate analysis take care of non-independence of observations due to repeated measures.
 jonas helao posted on Friday, January 24, 2014 - 1:55 pm
I have a question. I have binary mediators and a binary outcome.
I want to build a random intercept (fixed slope) model. Can I use this specification or is this specification only allowed for continuous outcomes/mediators?

1-1-1 model with fixed slopes (MSEM)

TITLE: 1-1-1 mediation (MSEM)
DATA: FILE IS mydata.dat; ! text file containing raw data in long format
VARIABLE: NAMES ARE
id x m y u;
USEVARIABLES ARE
id x m y u;
CLUSTER IS id; ! Level-2 grouping identifier
within = x m y
between = u
ANALYSIS: TYPE IS TWOLEVEL RANDOM;
MODEL: ! model specification follows
%WITHIN% ! Model for Within effects follows
m ON x(aw); ! regress m on x, call the slope "aw"
y ON m(bw); ! regress y on m, call the slope "bw"
y ON x; ! regress y on x
%BETWEEN% ! Model for Between effects follows
y ON U
MODEL CONSTRAINT: ! section for computing indirect effects
NEW(indw); ! name the indirect effects
indw=aw*bw; ! compute the Within indirect effect
 Linda K. Muthen posted on Friday, January 24, 2014 - 2:40 pm
You need the CATEGORICAL option for the mediators and outcome if they are binary. Otherwise, I think the specification looks okay. You don't need RANDOM for a random intercept model only for a random slope model. See Examples 9.1 and 9.2. The indirect effect cannot be defined as the product with maximum likelihood estimation and a categorical outcome. See the following paper on the website for the proper specification:

Muthén, B. (2011). Applications of causally defined direct and indirect effects in mediation analysis using SEM in Mplus.

These effects will be automated in the next version of Mplus.
 jonas helao posted on Saturday, January 25, 2014 - 11:27 am
Thank you.

What do I have to change in the code above? It is not clear for me in the reference.
 jonas helao posted on Saturday, January 25, 2014 - 1:05 pm
I mean: how to model the indirect effect. The rest is clear to me.
 Linda K. Muthen posted on Sunday, January 26, 2014 - 10:10 am
If you can't understand how to specify the indirect effects from the paper mentioned above, you will need to wait until Version 7.2 where they will be automated.
 claudio barbaranelli posted on Saturday, August 09, 2014 - 2:09 am
Hi,
I am running a multilevel model described by Hayes in his handouts (www.afhayes.com/public/aps2013.pdf) slide 25. My problem is with my dependent variable that is highly skewed. When I define it as a categorical or as a censored variable I receive an error message.
So these are the MPLUS code lines:
INPUT INSTRUCTIONS
...
VARIABLE:
..
categorical are pctunrep;
usev are pctunrep moral AUTOR ;
cluster = organiz;
between = AUTOR ;
analysis: type = twolevel random;
estimator=mlf;
model: %within%
s_b | pctunrep on moral;
%between%
[s_b] (bw);
s_b with moral pctunrep;
moral on AUTOR (a1);
pctunrep on moral (bb);
pctunrep on AUTOR (cp1);
MODEL CONSTRAINT:
new (dir1 ind1 ) ;
ind1 = (a1)*(bw+bb);
dir1 = cp1;

this is the error:
*** ERROR in MODEL command
Observed variable on the right-hand side of a between-level ON statement
must be a BETWEEN variable. Problem with: MORAL
*** ERROR
The following MODEL statements are ignored:
* Statements in the BETWEEN level:
PCTUNREP ON MORAL

When I omit
categorical are pctunrep;
the model runs perfectly.
All the best
Claudio
 Linda K. Muthen posted on Saturday, August 09, 2014 - 12:19 pm
When you add the CATEGORICAL option, numerical integration is required. This is the difference. You can put a factor behind moral and use that on the right-hand side of on, for example,

fmoral BY moral@1;
moral@0;
 claudio barbaranelli posted on Sunday, August 10, 2014 - 4:58 am
great !
I'll try !
thanks Linda ... as usual !
All the best
Claudio
 claudio barbaranelli posted on Sunday, August 10, 2014 - 5:54 am
hi Linda
still problems when using the solution you suggested.
Here's the model
analysis:
type = twolevel random;
estimator=mlf;
ALGORITHM=INTEGRATION;


model: %within%

fmoral_W by moral@1;
moral@0;

s_b | pctunrep on fmoral_W;


%between%
fmoral_B by moral@1;
moral@0;
Fautor by AUTOR@1;
AUTOR@0;

[s_b] (bw);
s_b with fmoral_B pctunrep;

fmoral_B on Fautor (a1);
pctunrep on fmoral_B (bb);
pctunrep on Fautor (cp1);


MODEL CONSTRAINT:
new (dir1 ind1 ) ;
ind1 = (a1)*(bw+bb);
dir1 = cp1;

here the problems...

THE ESTIMATED WITHIN COVARIANCE MATRIX COULD NOT BE INVERTED.
COMPUTATION COULD NOT BE COMPLETED IN ITERATION 1.
CHANGE YOUR MODEL AND/OR STARTING VALUES.



THE MODEL ESTIMATION DID NOT TERMINATE NORMALLY DUE TO AN ERROR IN THE
COMPUTATION. CHANGE YOUR MODEL AND/OR STARTING VALUES.

Any suggestion ?
Thanks
Claudio
 Linda K. Muthen posted on Sunday, August 10, 2014 - 8:47 am
Please send the full output and your license number to support@statmodel.com.
Back to top
Add Your Message Here
Post:
Username: Posting Information:
This is a private posting area. Only registered users and moderators may post messages here.
Password:
Options: Enable HTML code in message
Automatically activate URLs in message
Action: