Message/Author 

Edward Mak posted on Sunday, June 08, 2008  2:38 am



I am a beginner of Mplus, and I am trying to run a multilevel analysis. After running the program, a within level matrix and a between level matrix are shown. My aim is to get one sample betweengroups covariance matrix and one pooled wtihingroups covariance matrix for inputing into a LISREL program. However, I know that the sample betweengroups covariance matrix equals to the summation of unbiased estimate of population withingroups covariance matrix and a scalar times the population betweengroups covariance matrix. So my questions are: 1. the between level matrix offered by Mplus is the sample betweengroups covariance matrix or the population betweengroups covariance matrix. 2. if the between level matrix offered by Mplus is the population betweengroups covariance matrix, can I get the scalar by Mplus? Thank you very much. 


1. What is printed depends on the scale of the dependent variables. See the SAMPLE and SIGB options of the SAVEDATA command for more information. 2. See Formula 201 of Technical Appendix 10 on the website or use the average cluster size as an approximation. 

Edward Mak posted on Monday, June 09, 2008  6:53 pm



Dear Linda, Thank you for your quick reply. I'm sorry that I still do not understand. The following is part of the printed results .Would you mind spend some time to take a look? SAMPLE STATISTICS NOTE: The sample statistics for within and between refer to the maximumlikelihood estimated within and between covariance matrices, respectively. ESTIMATED SAMPLE STATISTICS FOR WITHIIN . . . ESTIMATED SAMPLE STATISTICS FOR BETWEEN . . . My questions are 1. Is the matrix of the printout "ESTIMATED SAMPLE STATISTICS FOR WITHIIN" = unbiased estimator of the pooled withingroups covatiance? 2. Is the matrix of the printout "ESTIMATED SAMPLE STATISTICS FOR BETWEEN" = unbiased estimator of the betweengroups covatiance, i.e. the E(S_B) of the formula 199 in Technical Appendix 10? Thank you very much. Edward 


From page 600 of the Mplus User's Guide: WITHIN For TYPE=TWOLEVEL and maximum likelihood estimation, the sample correlation and covariance matrices are the maximum likelihood estimated sigma within covariance and correlation matrices. For TYPE=TWOLEVEL and weighted least squares estimation, the sample correlation and covariance matrices are the pairwise maximum likelihood estimated sigma within covariance and correlation matrices. For ESTIMATOR=MUML, the sample correlation and covariance matrices are the sample pooledwithin correlation and covariance matrices. BETWEEN For maximum likelihood estimation, it is the consistent maximum likelihood estimate of sigma between. For weighted least squares estimation, it is the pairwise maximum likelihood estimated sigma between covariance and correlation matrices. For ESTIMATOR=MUML, it is the unbiased estimate of sigma between. This can be summarized for continuous outcomes according to your 2 questions. The printout you refer to says ML estimates which are consistent, not unbiased. The unbiased versions are given in the formulas 197 and 198. 

Edward Mak posted on Wednesday, June 18, 2008  10:17 pm



Dear Linda, Thank you very much for your great help. Edward 

Utkun Ozdil posted on Thursday, February 10, 2011  1:47 pm



Dear Linda,, My question is about writing the MPlus syntax for the "estimation of the within structure" and the "estimation of the between structure" in proceeding the steps in Bengt's 1994 article. I'm puzzled in that: In order to estimate the within structure am I to specify a new data set with sample size nG; and with sample size G for the between structure partially. Or am I to write TYPE= TWOLEVEL and write only %WITHIN% to get the within structure and then write only %BETWEEN% to get the between structure? As a matter of fact I am unsure about how to write Mplus syntax to proceed these steps. Can you give an example syntax if possible? Thanks.. Utkun 


For the steps of the 1994 article you would first save the within and between covariance matrices. For the within analysis you would have as data the within covariance matrix and use a singlelevel analysis (not Type=Twolevel). Analogous for the between analysis. 

Utkun Ozdil posted on Friday, February 11, 2011  12:06 am



Two follow up questions; 1In this sense,, without typing anything on the ANALYSIS: part I will only type on the SAVE DATA: command the SIGBETWEEN IS for the between structure and the SAMPLE IS for the within structure? 2 For both the within and the between structure,, in the MODEL: command I will type my single level model which I estimated in step 1? Thanks... 


1. You would specify TPYE=TWOLEVEL BASIC; in the ANALYSIS command. Do not include a MODEL command. Use the WITHIN and BETWEEN options of the VARIABLE command appropriately. 2. You would use TYPE=COVARIANCE; in the DATA command. See the DATA command and Example 13.1 for further information. You would specify a singlelevel model in the MODEL command. It may not be the same for both within and between. And for NOBSERVATIONS, you use ng for within and g for between. 


Dear Linda, Thanks for your reply to my previous question in the Building a Multilevel Model thread. As a follow up, I have a separate question that I think fits better within this particular discussion. I am trying to run a model with 4 factors on the within level (3 of which have 3 indicators, and 1 is a singleitem), and on the between level I have those same 4 plus two between factor (1 has 3 indicators, the other is a singleitem). I have managed to successfully run a multilevel CFA using the TWOLEVEL approach (%Within% and %Between%). However, I'm having a devil of a time achieving convergence when I run the structural model. As a last resort, I have gone back and created the separate covariance matrices (Type = Two Level; SAVEDATA: sample=within.dat; sigb=between.dat), which seems similar to Bengt's 1994 article. Using these matrices I reran separate CFAs and got matching results to those achieved with the TWOLEVEL approach. Also, using these matrices I was able to run and achieve convergence for each of the structural models (within and between)separately. I believe this approach precludes me from estimating crosslevel effects (random slopes); but, otherwise is this separate matrix analyses an acceptable approach for estimating my structural models if I am only interested in the discrete effects at each level? 


This is a good preliminary step but you need to run the full model. Please send the CFA output and the SEM output and your license number to support@statmodel.com. 

jenny liao posted on Saturday, May 12, 2012  6:11 pm



Hi, In doing a MLCFA, Im trying to save a within (sample) and between (sigb) covariance matrix, although after saving it, and using the new file to run it, I get this *** ERROR Insufficient data in "spw.dat" I checked the dat file, and the covariance matrix seems to be missing the last 2 values, do you have any clue as to how I might be doing it wrong? Thanks heaps in advance, jenny. 


Please send the relevant files and your license number to support@statmodel.com. 

Melvin C Y posted on Friday, January 04, 2013  8:53 pm



Can I use summary data (i.e., covariance matrix) for multilevel analysis? I'm thinking that I might have to enter a within and betwen data? If possible, how would the syntax look like? Thanks. 


No, you must have individual level data for multilevel analysis. 

John G posted on Thursday, April 27, 2017  8:33 am



I have been developing a model analogous to Example 1 in Preacher, Zypher, & Zhang (2010). This is a 1(1,1)1 MSEM model where all variables were observed at the individual level on ten separate occasions over a twoweek period. I would like to include a correlation matrix for both within and betweenperson correlations. Is there a specific output command that will ask Mplus to provide this information? Thanks in advance. 


Use Type = twolevel basic to get sample quantities or ask for Residual to get modelestimated quantities. 

John G posted on Thursday, April 27, 2017  8:46 pm



Perfect. Thanks! 

anonymous posted on Wednesday, June 21, 2017  11:39 am



Good afternoon. I'm wondering what the best way would be to to compute the significance levels for the basic correlations that are derived from Type = twolevel basic. The output doesn't seem to have the SE's and I need a full correlation matrix between and within my variables. Thanks so much in advance. 


You would have to set up and unrestricted model via the Model command and request standardized. 


Hi, my question is closely related to the one before. I have a twolevel model and wish to report a correlation matrix. The one I obtain in SPSS strongly differs to the twolevel basic one in MPlus which I assume may be attributed to the fact that the latent means I obtain in Mplus are different to the meanaggegrates I get in SPSS (in fact that would be my first question: how can it be the case that these differ so strongly  I don't have any missing values so it can't be due to FIML, right?). Accordingly, I think it makes more sense to report the results obtained via MPlus. Your comment before says that to compute significance levels one would need to set up an unrestricted model via the model command. I am not entirely sure I understand what that means. I computed a twolevel model and inserted WITH commands between all my variables but would those correlations be independent from each other, i.e. comparable with a correlation matrix in SPSS? Thanks in advance! 


I don't know if SPSS does this variable by variable instead of as a multivariate approach. What Mplus does is explained in the FAQ Icc changes from one model to another 

Back to top 