UCLA Academic Technology Services HomeServicesClassesContactJobs
Search

Annotated Mplus Output
Ordinary Least Squares Regression

This page shows an example of ordinary least squares (OLS) regression with footnotes explaining the output. First an example is shown using Stata, and then an example is shown using Mplus, to help you relate the output you are likely to be familiar with (Stata) to output that may be new to you (Mplus). We suggest that you view this page using two web browsers so you can show the page side by side showing the Stata output in one browser and the corresponding Mplus output in the other browser. 

This example is drawn from the Mplus User's Guide (example 3.1) and we suggest that you see the Mplus User's Guide for more details about this example. We thank the kind people at Muthén & Muthén for permission to use examples from their manual.

Example Using Stata

Here is an OLS regression example using Stata with two continuous predictors x1 and x2 used to predict a continuous outcome variable, y.

infile y1 x1 x3 using http://www.ats.ucla.edu/stat/mplus/output/ex3.1.dat, clear
regress y1 x1 x3

      Source |       SS       df       MS              Number of obs =     500
-------------+------------------------------           F(  2,   497) =  387.13
       Model |   733.16883     2  366.584415           Prob > F      =  0.0000
    Residual |  470.626985   497  .946935583B          R-squared     =  0.6090
-------------+------------------------------           Adj R-squared =  0.6075
       Total |  1203.79581   499  2.41241646           Root MSE      =  .97311

------------------------------------------------------------------------------
          y1 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
          x1 |   .9694892A  .0416319    23.29   0.000      .887693    1.051285
          x3 |   .6490392A  .0445076    14.58   0.000     .5615929    .7364854
       _cons |   .5109608C  .0435592    11.73   0.000      .425378    .5965436
------------------------------------------------------------------------------

The output is labeled with superscripts to help you relate the later Mplus output to this Stata output. To summarize the output, both predictors in this model, x1 and x2, are significantly related to the outcome variable, u1.


Mplus Example #1

Here is the same example illustrated in Mplus based on the ex3.1.dat data file. 

TITLE:
  this is an example of a simple linear
  regression for a continuous observed
  dependent variable with two covariates
DATA:	
  FILE IS ex3.1.dat;
VARIABLE:	
  NAMES ARE y1 x1 x3;
MODEL:	
  y1 ON x1 x3;
SUMMARY OF ANALYSIS

Number of observations                                         500

MODEL RESULTS
                   Estimates     S.E.  Est./S.E.
 Y1       ON
    X1                 0.969A    0.042     23.357
    X3                 0.649A    0.044     14.626

 Residual Variances
    Y1                 0.941B    0.060     15.811
  1. These are the regression coefficients predicting y1 from x1 and x3, see output of regress command from Stata.
  2. This is the residual variance y1 . It is analogous to the mean square error (MSE) from the Stata output. The slight differences in the Mplus vs. Stata values are due to differences in estimation techniques.

Mplus Example #2

Note that the previous example did not include an intercept in the model. By specifying

analysis:
  type=meanstructure;

in the example below, we indicate that the model should model means as well as covariances, and the following model does include an intercept. Here is this modified example illustrated in Mplus based on the ex3.1.dat data file.

TITLE:
  this is an example of a simple linear
  regression for a continuous observed
  dependent variable with two covariates
DATA:	
  FILE IS ex3.1.dat;
analysis:
  type=meanstructure;
VARIABLE:	
  NAMES ARE y1 x1 x3;
MODEL:	
  y1 ON x1 x3;
MODEL RESULTS
                   Estimates     S.E.  Est./S.E.
 Y1       ON
    X1                 0.969A    0.042     23.357
    X3                 0.649A    0.044     14.626

 Intercepts
    Y1                 0.511C    0.043     11.765

 Residual Variances
    Y1                 0.941B    0.060     15.811
 
  1. These are the regression coefficients predicting g y1 from x1 and x3, see output of regress command from Stata.
  2. This is the residual variance y1 . It is analogous to the mean square error (MSE) from the Stata output. The slight differences in the Mplus vs. Stata values are due to differences in estimation techniques.
  3. Here is the intercept for this model. It is the predicted value for y1 when all predictors of y1 (that is x1 and x3) are held constant at 0. Note this matches the value for _cons from the Stata regression results.

How to cite this page

Report an error on this page

UCLA Researchers are invited to our Statistical Consulting Services
We recommend others to our list of Other Resources for Statistical Computing Help
These pages are Copyrighted (c) by UCLA Academic Technology Services


The content of this web site should not be construed as an endorsement of any particular web site, book, or software product by the University of California