Announcement

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

  • Any model for non-linear panel regression.

    Dear Statalist Forum Members,

    It might not be right to ask my question here, but I have no place to ask though I did a little search on it. If anyone knows the solution to my problem, you are most welcome. My question is how to run a non-linear panel regression model for my model where my dependent variable is binary dummy (0,1) for 3 time periods across 5000 households. During my search, It was suggested that menl command works for it. But I am not sure. Can someone help me.

  • #2
    So you have panel data. I would definitely recommend the community-contributed commands probitfe and logitfe, which try to tackle the incidental parameter problem.

    Comment


    • #3
      Hi Morlet, Thank you so much for your timely support. However, I tried as you said, but I got an error 198 saying that my dependent variable is not 0/1. Actually, it is a dummy one. Please see the picture below and suggest me the solution.


      Click image for larger version

Name:	Capture.JPG
Views:	1
Size:	32.4 KB
ID:	1694480

      Comment


      • #4
        Please type
        Code:
        sum onlineeducation
        and post the output.

        Also, it would be helpful to see an extract of all your data using dataex.

        Comment


        • #5
          please see the output. And I regret to say that the dataset has not been shared as it is still official and has not yet been released for public use.

          Click image for larger version

Name:	Capture.JPG
Views:	1
Size:	15.9 KB
ID:	1694486

          Comment


          • #6
            You seem to be understanding each other, and I do not. So my suggestion might be offsite.

            For a binary dependent variable, if you want to fit a random effects panel data model, -xtprobit- and -xtlogit- would both do.

            If you want to fit a panel data fixed effects model, you can use -xtlogit-. (There is no fixed effects probit.)

            Comment


            • #7
              I am not too familiar with these commands, but karthick veerapandian you find this paper interesting: https://arxiv.org/pdf/1610.07714.pdf.

              Comment


              • #8
                Dear Kolev and Morlet,
                Many thanks to you both. Your responses hopefully solve my issues. If there is anything, I will get back to you. Thanks again.

                Comment


                • #9
                  Yes, It worked very well; how do I choose the model between fe and re.

                  Comment


                  • #10
                    Originally posted by karthick veerapandian View Post
                    Yes, It worked very well; how do I choose the model between fe and re.
                    I presume you have gone for -logit- then. You choose FE vs RE either based on theory, or statistically based on the Hausman test.

                    Comment


                    • #11
                      RE makes absolutely implausible assumptions, so if your regressor of interest varies with time, include minimum two-way fixed effects (unit and time).

                      Comment


                      • #12
                        For example:

                        Code:
                        . webuse union
                        (NLS Women 14-24 in 1968)
                        
                        . xtlogit union age grade i.not_smsa south##c.year, re nolog
                        
                        Random-effects logistic regression                   Number of obs    = 26,200
                        Group variable: idcode                               Number of groups =  4,434
                        
                        Random effects u_i ~ Gaussian                        Obs per group:
                                                                                          min =      1
                                                                                          avg =    5.9
                                                                                          max =     12
                        
                        Integration method: mvaghermite                      Integration pts. =     12
                        
                                                                             Wald chi2(6)     = 227.46
                        Log likelihood = -10540.274                          Prob > chi2      = 0.0000
                        
                        ------------------------------------------------------------------------------
                               union | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
                        -------------+----------------------------------------------------------------
                                 age |   .0156732   .0149895     1.05   0.296    -.0137056     .045052
                               grade |   .0870851   .0176476     4.93   0.000     .0524965    .1216738
                          1.not_smsa |  -.2511884   .0823508    -3.05   0.002    -.4125929   -.0897839
                             1.south |  -2.839112   .6413116    -4.43   0.000    -4.096059   -1.582164
                                year |  -.0068604   .0156575    -0.44   0.661    -.0375486    .0238277
                                     |
                        south#c.year |
                                  1  |   .0238506   .0079732     2.99   0.003     .0082235    .0394777
                                     |
                               _cons |  -3.009365   .8414963    -3.58   0.000    -4.658667   -1.360062
                        -------------+----------------------------------------------------------------
                            /lnsig2u |   1.749366   .0470017                      1.657245    1.841488
                        -------------+----------------------------------------------------------------
                             sigma_u |   2.398116   .0563577                      2.290162    2.511158
                                 rho |   .6361098   .0108797                      .6145307    .6571548
                        ------------------------------------------------------------------------------
                        LR test of rho=0: chibar2(01) = 6004.43                Prob >= chibar2 = 0.000
                        
                        . est sto re
                        
                        . xtlogit union age grade i.not_smsa south##c.year, fe nolog
                        note: multiple positive outcomes within groups encountered.
                        note: 2,744 groups (14,165 obs) omitted because of all positive or
                              all negative outcomes.
                        
                        Conditional fixed-effects logistic regression        Number of obs    = 12,035
                        Group variable: idcode                               Number of groups =  1,690
                        
                                                                             Obs per group:
                                                                                          min =      2
                                                                                          avg =    7.1
                                                                                          max =     12
                        
                                                                             LR chi2(6)       =  78.60
                        Log likelihood = -4510.888                           Prob > chi2      = 0.0000
                        
                        ------------------------------------------------------------------------------
                               union | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
                        -------------+----------------------------------------------------------------
                                 age |   .0710973   .0960536     0.74   0.459    -.1171643    .2593589
                               grade |   .0816111   .0419074     1.95   0.051    -.0005259     .163748
                          1.not_smsa |   .0224809   .1131786     0.20   0.843     -.199345    .2443069
                             1.south |  -2.856488   .6765694    -4.22   0.000    -4.182539   -1.530436
                                year |  -.0636853   .0967747    -0.66   0.510    -.2533602    .1259896
                                     |
                        south#c.year |
                                  1  |   .0264136   .0083216     3.17   0.002     .0101036    .0427235
                        ------------------------------------------------------------------------------
                        
                        . hausman re .
                        
                                         ---- Coefficients ----
                                     |      (b)          (B)            (b-B)     sqrt(diag(V_b-V_B))
                                     |       re           .          Difference       Std. err.
                        -------------+----------------------------------------------------------------
                                 age |    .0156732     .0710973       -.0554241               .
                               grade |    .0870851     .0816111        .0054741               .
                          1.not_smsa |   -.2511884     .0224809       -.2736693               .
                             1.south |   -2.839112    -2.856488         .017376               .
                                year |   -.0068604    -.0636853        .0568249               .
                        south#c.year |
                                  1  |    .0238506     .0264136        -.002563               .
                        ------------------------------------------------------------------------------
                                                b = Consistent under H0 and Ha; obtained from xtlogit.
                                 B = Inconsistent under Ha, efficient under H0; obtained from xtlogit.
                        
                        Test of H0: Difference in coefficients not systematic
                        
                        chi2(6) = (b-B)'[(V_b-V_B)^(-1)](b-B)
                                = -17.48
                        
                        Warning: chi2 < 0 ==> model fitted on these data
                                 fails to meet the asymptotic assumptions
                                 of the Hausman test; see suest for a
                                 generalized test.
                        
                        .

                        Comment


                        • #13
                          Thanks very much to you both... You both made my things so sweet. Thanks again. I will take a leave for now.

                          Comment


                          • #14
                            A few comments if karthick comes back. Of course, one can always attempt to include 5,000 dummies in a probit or logit, but, even with corrections for bias as in probitfe and logitfe, this is a bad idea with T = 3. Moreover, those commands impose exchangeability and, usually, serial indepdence. And standard errors would not be at all reliable.

                            xtlogit -- which is a conditional MLE -- has a few problems. One is that it imposes serial independence and it is inconsistent if that fails. This is unlike a linear model. Second, you only get coefficients, not marginal effects.

                            With T = 3 I strongly recommend the correlated random effects probit. You include the time averages of the time-varying explanatory variables along with time dummies and time constant variables. You compute marginal effects with respect to each variable. Use cluster robust standard errors. I discuss this approach in Chapter 15 of my MIT Press book. It's also computationally simple, and you can, if desired, test the time averages for significance. While I don't prefer it, you can include the time averages in xtprobit with the re option, but this imposes serial independence across t.

                            Here's a post about a similar issue:

                            https://www.statalist.org/forums/for...for-panel-data

                            Comment

                            Working...
                            X