Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Maximum likelihood with complete information

    Hi everyone, I need to know what is de command for the reg of Maximun Likelihood with complete information
    Thanks

  • #2
    What do you mean with "complete information"?
    What is your model (maximum likelihood is a way to estimate coefficients of a model, it is not the model itself)?
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment


    • #3
      Perhaps Juan is referring to full information maximum likelihood (FIML) which is an alternative to multiple imputation (MI). If so, you can use sem specifying the option -mlmv- (i.e. maximum likelihood with missing values).

      Code:
      sysuse auto, clear
      misstable sum
      regress mpg displacement weight rep78
      sem (mpg <- displacement weight rep78), method(mlmv)
      Res.:

      Code:
      . regress mpg displacement weight rep78
      
            Source |       SS           df       MS      Number of obs   =        69
      -------------+----------------------------------   F(3, 65)        =     41.57
             Model |  1538.32916         3  512.776386   Prob > F        =    0.0000
          Residual |  801.873741        65  12.3365191   R-squared       =    0.6573
      -------------+----------------------------------   Adj R-squared   =    0.6415
             Total |   2340.2029        68  34.4147485   Root MSE        =    3.5123
      
      ------------------------------------------------------------------------------
               mpg |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
      -------------+----------------------------------------------------------------
      displacement |   .0052128    .012669     0.41   0.682    -.0200889    .0305145
            weight |  -.0062376     .00148    -4.21   0.000    -.0091935   -.0032818
             rep78 |   .5863166   .4727835     1.24   0.219    -.3578973    1.530531
             _cons |   37.17348   3.193452    11.64   0.000     30.79571    43.55124
      ------------------------------------------------------------------------------
      
      . 
      . sem (mpg <- displacement weight rep78), method(mlmv)
      note: Missing values found in observed exogenous variables. Using the noxconditional behavior. Specify the forcexconditional option to override this
            behavior.
      Endogenous variables
      
      Observed:  mpg
      
      Exogenous variables
      
      Observed:  displacement weight rep78
      
      Fitting saturated model:
      
      Iteration 0:   log likelihood = -1264.4132  
      Iteration 1:   log likelihood = -1261.0665  
      Iteration 2:   log likelihood = -1260.9297  
      Iteration 3:   log likelihood = -1260.9294  
      Iteration 4:   log likelihood = -1260.9294  
      
      Fitting baseline model:
      
      Iteration 0:   log likelihood = -1300.8914  
      Iteration 1:   log likelihood = -1300.8908  
      Iteration 2:   log likelihood = -1300.8908  
      
      Fitting target model:
      
      Iteration 0:   log likelihood = -1260.9294  
      Iteration 1:   log likelihood = -1260.9294  
      
      Structural equation model                       Number of obs     =         74
      Estimation method  = mlmv
      Log likelihood     = -1260.9294
      
      -----------------------------------------------------------------------------------------
                              |                 OIM
                              |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
      ------------------------+----------------------------------------------------------------
      Structural              |
        mpg                   |
                 displacement |    .007011   .0097105     0.72   0.470    -.0120212    .0260432
                       weight |  -.0064733   .0011392    -5.68   0.000     -.008706   -.0042406
                        rep78 |   .5652976   .4424824     1.28   0.201     -.301952    1.432547
                        _cons |   37.53372   2.803958    13.39   0.000     32.03806    43.02937
      ------------------------+----------------------------------------------------------------
            mean(displacement)|   197.2973   10.60348    18.61   0.000     176.5149    218.0797
                  mean(weight)|   3019.459   89.73439    33.65   0.000     2843.583    3195.336
                   mean(rep78)|    3.40722   .1171219    29.09   0.000     3.177665    3.636775
      ------------------------+----------------------------------------------------------------
                    var(e.mpg)|   11.20474   1.843411                      8.116366    15.46828
             var(displacement)|   8320.101   1367.816                      6028.259    11483.26
                   var(weight)|   595867.3   97959.98                      431730.6    822405.9
                    var(rep78)|   .9575829   .1618018                      .6876219    1.333531
      ------------------------+----------------------------------------------------------------
      cov(displacement,weight)|    63010.3      10984     5.74   0.000     41482.05    84538.54
       cov(displacement,rep78)|  -35.92531   11.40825    -3.15   0.002    -58.28506   -13.56556
             cov(weight,rep78)|  -291.7716   95.44073    -3.06   0.002     -478.832   -104.7112
      -----------------------------------------------------------------------------------------
      Note: The LR test of model vs. saturated is not reported because the fitted
            model is not full rank.

      Comment


      • #4
        As a sidelight, I would like to see more commands support a fiml option when possible.
        -------------------------------------------
        Richard Williams, Notre Dame Dept of Sociology
        Stata Version: 17.0 MP (2 processor)

        EMAIL: [email protected]
        WWW: https://www3.nd.edu/~rwilliam

        Comment


        • #5
          Originally posted by Andrew Musau View Post
          Perhaps Juan is referring to full information maximum likelihood (FIML) which is an alternative to multiple imputation (MI). If so, you can use sem specifying the option -mlmv- (i.e. maximum likelihood with missing values).

          Code:
          sysuse auto, clear
          misstable sum
          regress mpg displacement weight rep78
          sem (mpg <- displacement weight rep78), method(mlmv)
          Res.:

          Code:
          . regress mpg displacement weight rep78
          
          Source | SS df MS Number of obs = 69
          -------------+---------------------------------- F(3, 65) = 41.57
          Model | 1538.32916 3 512.776386 Prob > F = 0.0000
          Residual | 801.873741 65 12.3365191 R-squared = 0.6573
          -------------+---------------------------------- Adj R-squared = 0.6415
          Total | 2340.2029 68 34.4147485 Root MSE = 3.5123
          
          ------------------------------------------------------------------------------
          mpg | Coef. Std. Err. t P>|t| [95% Conf. Interval]
          -------------+----------------------------------------------------------------
          displacement | .0052128 .012669 0.41 0.682 -.0200889 .0305145
          weight | -.0062376 .00148 -4.21 0.000 -.0091935 -.0032818
          rep78 | .5863166 .4727835 1.24 0.219 -.3578973 1.530531
          _cons | 37.17348 3.193452 11.64 0.000 30.79571 43.55124
          ------------------------------------------------------------------------------
          
          .
          . sem (mpg <- displacement weight rep78), method(mlmv)
          note: Missing values found in observed exogenous variables. Using the noxconditional behavior. Specify the forcexconditional option to override this
          behavior.
          Endogenous variables
          
          Observed: mpg
          
          Exogenous variables
          
          Observed: displacement weight rep78
          
          Fitting saturated model:
          
          Iteration 0: log likelihood = -1264.4132
          Iteration 1: log likelihood = -1261.0665
          Iteration 2: log likelihood = -1260.9297
          Iteration 3: log likelihood = -1260.9294
          Iteration 4: log likelihood = -1260.9294
          
          Fitting baseline model:
          
          Iteration 0: log likelihood = -1300.8914
          Iteration 1: log likelihood = -1300.8908
          Iteration 2: log likelihood = -1300.8908
          
          Fitting target model:
          
          Iteration 0: log likelihood = -1260.9294
          Iteration 1: log likelihood = -1260.9294
          
          Structural equation model Number of obs = 74
          Estimation method = mlmv
          Log likelihood = -1260.9294
          
          -----------------------------------------------------------------------------------------
          | OIM
          | Coef. Std. Err. z P>|z| [95% Conf. Interval]
          ------------------------+----------------------------------------------------------------
          Structural |
          mpg |
          displacement | .007011 .0097105 0.72 0.470 -.0120212 .0260432
          weight | -.0064733 .0011392 -5.68 0.000 -.008706 -.0042406
          rep78 | .5652976 .4424824 1.28 0.201 -.301952 1.432547
          _cons | 37.53372 2.803958 13.39 0.000 32.03806 43.02937
          ------------------------+----------------------------------------------------------------
          mean(displacement)| 197.2973 10.60348 18.61 0.000 176.5149 218.0797
          mean(weight)| 3019.459 89.73439 33.65 0.000 2843.583 3195.336
          mean(rep78)| 3.40722 .1171219 29.09 0.000 3.177665 3.636775
          ------------------------+----------------------------------------------------------------
          var(e.mpg)| 11.20474 1.843411 8.116366 15.46828
          var(displacement)| 8320.101 1367.816 6028.259 11483.26
          var(weight)| 595867.3 97959.98 431730.6 822405.9
          var(rep78)| .9575829 .1618018 .6876219 1.333531
          ------------------------+----------------------------------------------------------------
          cov(displacement,weight)| 63010.3 10984 5.74 0.000 41482.05 84538.54
          cov(displacement,rep78)| -35.92531 11.40825 -3.15 0.002 -58.28506 -13.56556
          cov(weight,rep78)| -291.7716 95.44073 -3.06 0.002 -478.832 -104.7112
          -----------------------------------------------------------------------------------------
          Note: The LR test of model vs. saturated is not reported because the fitted
          model is not full rank.
          Dear Andrew, it doesn´t matter if I am using an equations system? is the same sintaxys?

          Comment


          • #6
            It depends what model you want to fit. If it is a linear regression model, then you do that as specified in #3. Notice below that without missing values, you obtain the same coefficients with sem as you do with regress.

            Code:
             sysuse auto, clear
            (1978 Automobile Data)
            
            . regress mpg headroom weight, robust
            
            Linear regression                               Number of obs     =         74
                                                            F(2, 71)          =      58.52
                                                            Prob > F          =     0.0000
                                                            R-squared         =     0.6523
                                                            Root MSE          =     3.4594
            
            ------------------------------------------------------------------------------
                         |               Robust
                     mpg |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
            -------------+----------------------------------------------------------------
                headroom |  -.2103507   .4157304    -0.51   0.614    -1.039294    .6185922
                  weight |   -.005898   .0006819    -8.65   0.000    -.0072577   -.0045382
                   _cons |   39.73567   1.951442    20.36   0.000      35.8446    43.62673
            ------------------------------------------------------------------------------
            
            . sem (mpg <- headroom weight), method(mlmv) vce(robust)
            
            Endogenous variables
            
            Observed:  mpg
            
            Exogenous variables
            
            Observed:  headroom weight
            
            Fitting target model:
            
            Iteration 0:   log pseudolikelihood = -874.60268  
            Iteration 1:   log pseudolikelihood = -874.60268  
            
            Structural equation model                       Number of obs     =         74
            Estimation method    = mlmv
            Log pseudolikelihood = -874.60268
            
            ------------------------------------------------------------------------------
                         |               Robust
                         |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
            -------------+----------------------------------------------------------------
            Structural   |
              mpg        |
                headroom |  -.2103507   .4099959    -0.51   0.608    -1.013928    .5932266
                  weight |   -.005898   .0006725    -8.77   0.000    -.0072161   -.0045798
                   _cons |   39.73567   1.924524    20.65   0.000     35.96367    43.50767
            -------------+----------------------------------------------------------------
               var(e.mpg)|    11.4824   3.083837                       6.78305    19.43751
            ------------------------------------------------------------------------------

            Comment

            Working...
            X