Variances/covariances of Two-level-pr... PreviousNext
Mplus Discussion > Multilevel Data/Complex Sample >
Message/Author
 Roy Stewart posted on Sunday, April 22, 2018 - 5:27 am
Dear all,

I would like to calculate the variances/covariances of the predictors in a two level model (for both levels). The predictors can be either level1 or level2.

I try to do this with the commands:
SAVEDATA:
SWMATRIX is xxx.dat;

Is this command the right one? I doubt this because the outcome does not correspond to the example I am using this regard.

Is there an example to be found somewhere?

Thanks in advance for your answers or hints.
 Bengt O. Muthen posted on Sunday, April 22, 2018 - 10:17 am
Use Type = Twolevel Basic
 Roy Stewart posted on Sunday, April 22, 2018 - 11:29 am
Dear Dr Bengt Muthén,

Thank you very much for this hint.

I have tried to calculate this in Mplus.
But don't find the same result that corresponds to an example.
The example I am using comes from:
Browne WJ, Lahi MG, Parker RMA. A guide to sample size calculations for random effect models via simulation and the MLPowSim Software Package. 2009.
This is a two level model with three predictors on page 52-53 (section 2.3.5). I also have the tutorial-dataset.


With this dataset I do the analysis in Mplus.

The variances of the example are presented on page 53 of “Browne WJ, Lahi MG, Parker RMA. A guide to sample size calculations for random effect models via simulation and the MLPowSim Software Package. 2009”.
The results of the fixed and random effects are the same. But now it is a question of the variance of the predictors at the two levels.
Could I ask you to indicate where I am doing something wrong?
If the output of xxx is good, what is the reading format of this xxx file?
Thank you in advance.
 Roy Stewart posted on Sunday, April 22, 2018 - 11:50 am
Appendix 1:
The commands for MLwin were:


Title: TUTM1;
DATA:
FILE IS TUTM1.dat;
Variable:
NAMES ARE school student normex lrt gender ssex;
USEVARIABLES are school normex lrt gender ssex;
WITHIN = lrt gender;
BETWEEN = ssex;
CLUSTER = school;
ANALYSIS: TYPE = TWOLEVEL BASIC;
ESTIMATOR = WLS;
MODEL:
%WITHIN%
normex on lrt gender;
%BETWEEN%
normex on ssex;
OUTPUT: ;
SAVEDATA:
! SIGBETWEEN is sigbtw.dat;
! COVARIANCE is covtutm1.dat;
SWMATRIX is xxx.dat;
 Roy Stewart posted on Sunday, April 22, 2018 - 11:52 am
Appendix 2:
A printout of the xxx file is as follows:
0
11
1.664924212600095E-001
0.000000000000000E+000
5.600540225495404E-001
1.642697224662209E-001
1.657953055819991E-001
0.000000000000000E+000
0.000000000000000E+000
0.000000000000000E+000
5.623447415793688E-001
0.000000000000000E+000
8.111624514570197E-002
11
4
0
1
2
5
0
0
0
3
0
6
21
9.705901486719815E-005
-3.087828810183569E-005
1.610881788004373E-003
-3.868118646682709E-005
-4.271794467172336E-005
8.942089313837263E-005
-7.256970326288085E-005
-1.142790084333635E-003
2.709130539698872E-005
3.268441121539610E-003
-9.042257870915369E-005
5.291589664267878E-005
-5.924227458376269E-005
-2.217894762323952E-003
6.276200742926954E-003
-5.153889556505159E-006
8.859399959234776E-005
-8.945341916632792E-006
-1.479020120040635E-004
5.909717079374929E-005
2.666230100148955E-004
 Bengt O. Muthen posted on Monday, April 23, 2018 - 4:56 pm
We ask that postings be limited to one window.

You should not have a Model statement when you use Type = Basic.
 Roy Stewart posted on Tuesday, April 24, 2018 - 7:17 am
Thank you very much for your reply.
And I'm sorry I'm using more than one window, I didn't notice that.
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: