UCLA Academic Technology Services HomeServicesClassesContactJobs

Mplus Data Analysis Examples
Logit Regression

Examples

Example 1:  Suppose that we are interested in the factors that influence whether or not a political candidate wins an election.  The outcome (response) variable is binary (0/1);  win or lose.  The predictor variables of interest are: the amount of money spent on the campaign, the amount of time spent campaigning negatively and whether or not the candidate is an incumbent.  Because the response variable is binary we need to use a model that handles 0/1 variables correctly. 

Example 2:  We wish to study the influence of age, gender and exercise on whether or not someone has a heart attack.  Again, we have a binary response variable, whether or not a heart attack occurs. 

Example 3:  How do variables, such as, GRE (Graduate Record Exam scores), GPA (grade point average), and prestige of the undergraduate program effect admission into graduate school. The response variable, admit/don't admit, is a binary variable.

Description of the Data

For our data analysis below, we are going to expand on Example 3 about getting into graduate school.  We have generated hypothetical data, which can be obtained by clicking on logit.dat. You can store this anywhere you like, but our examples will assume it has been stored in c:\data.  (Be sure NOT to include the names of the variables at the top of your text file.  Instead, the variables are names on the variable statement.)  You may want to do your descriptive statistics in a general use statistics package, such as SAS, Stata or SPSS.  In Mplus, you can a few descriptive statistics.

This hypothetical data set has a binary response (outcome, dependent) variable called admit. There are three predictor variables:  gre, gpa and topnotch, which is a binary predictor in which 1 indicates that the undergraduate institution was "top notch" and 0 indicates that it is not. 

NOTE:  This example was done using Mplus version 4.21.  The syntax may not work with earlier versions of Mplus.

  title: Mplus DAE for logit;
  data: file is "D:\logit.dat";
  variable: names are admit gre topnotch gpa;
  categorical = admit;
  analysis:
    type = basic;
  plot: type is plot1;

For this output only, we will display all of the information in the output.  You will want to look at this carefully to be sure that the data were read into Mplus correctly.  You will want to make sure that you have the correct number of observations, and that the categorical and continuous variables have been correctly specified.  We have not used a missing statement because we have no missing data in this data set.

INPUT READING TERMINATED NORMALLY

Mplus DAE logit;

SUMMARY OF ANALYSIS

Number of groups                                                 1
Number of observations                                         400

Number of dependent variables                                    4
Number of independent variables                                  0
Number of continuous latent variables                            0

Observed dependent variables

  Continuous
   GRE         TOPNOTCH    GPA

  Binary and ordered categorical (ordinal)
   ADMIT

Estimator                                                    WLSMV
Maximum number of iterations                                  1000
Convergence criterion                                    0.500D-04
Maximum number of steepest descent iterations                   20
Parameterization                                             DELTA

Input data file(s)
  D:\logit.dat

Input data format  FREE

SUMMARY OF CATEGORICAL DATA PROPORTIONS

    ADMIT
      Category 1    0.683
      Category 2    0.317

RESULTS FOR BASIC ANALYSIS

     ESTIMATED SAMPLE STATISTICS

           MEANS/INTERCEPTS/THRESHOLDS
              ADMIT$1       GRE           TOPNOTCH      GPA
              ________      ________      ________      ________
      1         0.475       587.700         0.162         3.390


           CORRELATION MATRIX (WITH VARIANCES ON THE DIAGONAL)
              ADMIT         GRE           TOPNOTCH      GPA
              ________      ________      ________      ________
 ADMIT
 GRE            0.243     13310.683
 TOPNOTCH       0.167         0.217         0.136
 GPA            0.232         0.384         0.243         0.144


     STANDARD ERRORS FOR ESTIMATED SAMPLE STATISTICS


           S.E. FOR MEANS/INTERCEPTS/THRESHOLDS
              ADMIT$1       GRE           TOPNOTCH      GPA
              ________      ________      ________      ________
      1         0.065         5.805     16598.305         0.019


           S.E. FOR CORRELATION MATRIX (WITH VARIANCES ON THE DIAGONAL)
              ADMIT         GRE           TOPNOTCH      GPA
              ________      ________      ________      ________
 ADMIT
 GRE            0.063      1040.244
 TOPNOTCH       0.061         0.049      6693.099
 GPA            0.060         0.039         0.047         0.012


Some Strategies You Might Try

Using the Logit Model

Before running the logit model, check to see if any cells (created by the crosstab of our categorical and response variables) are empty or particularly small.  If this occurs, there may be difficulty running the logit model.  (This crosstab should be done in a general use statistics package.)  In our example, none of the cells are too small or empty (has no cases), so we will run our logit model.

title: Mplus DAE for logit;

data: file is "D:\logit.dat";

variable: names are admit gre topnotch gpa;
categorical = admit;

analysis: 
type = general;
estimator = ml;
! need to use estimator = ml to make this a logistic model;

model: admit on gre topnotch gpa;
TESTS OF MODEL FIT

Loglikelihood

          H0 Value                        -239.065

Information Criteria

          Number of Free Parameters              4
          Akaike (AIC)                     486.130
          Bayesian (BIC)                   502.095
          Sample-Size Adjusted BIC         489.403
            (n* = (n + 2) / 24)

MODEL RESULTS

                   Estimates     S.E.  Est./S.E.

 ADMIT      ON
    GRE                0.002    0.001      2.314
    TOPNOTCH           0.437    0.292      1.498
    GPA                0.668    0.325      2.052

 Thresholds
    ADMIT$1            4.601    1.096      4.196

LOGISTIC REGRESSION ODDS RATIO RESULTS

 ADMIT      ON
    GRE                1.002
    TOPNOTCH           1.548
    GPA                1.949

The section called MODEL RESULTS shows the coefficients (B), their standard errors and the ratio of the estimate to the standard error.  The can be considered a z-test where values 2 and above are statistically significant.  Both gre and gpa are statistically significant while topnotch is not.  The interpretation of the coefficients can be awkward. For example, for a one unit increase in gpa, the log odds of being admitted to graduate school (versus not being admitted) increases by .668.  For this reason, many researchers prefer to exponentiate the coefficients and interpret them as odds ratios.  The results in terms of odds ratios are displayed in the next part of the output called LOGISTIC REGRESSION ODDS RATIO RESULTS.  For example, we can say that for a one unit increase in gpa, the odds of being admitted to graduate school (versus not being admitted) increased by a factor of 1.949. Since GRE scores do not increase by a single unit (they increase only in units of 10), a one unit increase is meaningless.  We can take the odds ratio and raise it to the 10th power, e.g., 1.002 ^ 10 = 1.02, and say for a 10 unit increase in GRE score, the odds of admission to graduate school increased by a factor of 1.02.

A logit model can incorporate either an intercept or a threshold (sometimes called a cutpoint) in the model.  Instead of reporting the intercept for the model, Mplus reports a threshold.  It is the same as the intercept, except it has the opposite sign (so the intercept would be -4.601).  For more information on the differences between intercepts and thresholds, please see http://www.stata.com/support/faqs/stat/oprobit.html .

Sample Write-up of the Analysis

Below is one way of describing these results.

A logit regression was used to predict admission to graduate school from GRE score, GPA, and whether the student was from a top notch university. GRE score and GPA were significant predictors of admission to graduate school, but being from a top notch university was not related to admission to graduate school. For every one unit increase in GPA, the odds of admission (versus non-admission) increased by a factor of 1.95, while for every ten unit increase in GRE score, such odds increased by a factor of 1.025.

Cautions, Flies in the Ointment

See Also


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.