Announcement

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

  • Proportional odd assumption for ordered logit regression in panel data

    Respected sir, I am using xtologit command for ordered logit regression for panel data. My dependent variable has three categories. I want to check proportional odds assumption. I have tried a lot but couldn't get right command. Please help me..
    Thank you
    Priya

  • #2
    Priya:
    a temptative reply would point you to -help suest-.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      If you look at Richard Williams' (Note Dame) website , http://www3.nd.edu/~rwilliam/ , he has documentation related to generalized logits and also some discussion of proportional odds.

      Comment


      • #4
        There are several ways to test the assumption with cross-sectional data, but I don't know how to do it with panel data. See https://www3.nd.edu/~rwilliam/stats3/Ologit01.pdf

        I might be tempted to just ignore the panel structure of the data and run a test. It could give you an idea of any obvious problems.
        -------------------------------------------
        Richard Williams, Notre Dame Dept of Sociology
        StataNow Version: 19.5 MP (2 processor)

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

        Comment


        • #5
          First thanks to all for your reply.
          - Carlo sir, I have read about 'suest' command after your suggestion but what I get to know that it is for comparing coefficients across models and I have to run only one model i.e with xtologit command. but i have tried to run this command just to have knowledge with my panel data with two different model, but this is not working.
          - Richard sir, as you mentioned I have also tried many commands after reading many posts on this forum but no one is working on panel data. Now what should I do?
          • Should I leave to worry about this and just go through whatever result ‘xtologit’ command is giving to me…
          Thank you
          Priya

          Comment


          • #6
            Priya:
            you can follow Richard's helpful advice and test a pooled ologit with clustered robust standard errors (instead of -xtologit-).
            See -ologit- entry in Stata .pdf manual.
            Kind regards,
            Carlo
            (Stata 19.0)

            Comment


            • #7
              Maybe look into something like the following. Start at the "Begin here" comment; the code above it is just to create a fictional dataset for illustration.

              .ÿ
              .ÿversionÿ15.1

              .ÿ
              .ÿclearÿ*

              .ÿ
              .ÿsetÿseedÿ`=strreverse("1485872")'

              .ÿ
              .ÿquietlyÿsetÿobsÿ250

              .ÿgenerateÿintÿpidÿ=ÿ_n

              .ÿgenerateÿdoubleÿpid_uÿ=ÿrnormal()

              .ÿgenerateÿdoubleÿtipÿ=ÿruniform()ÿ-ÿ0.5

              .ÿ
              .ÿquietlyÿexpandÿ5

              .ÿbysortÿpid:ÿgenerateÿbyteÿtimÿ=ÿ_n

              .ÿgenerateÿtdpÿ=ÿruniform()ÿ-ÿ0.5

              .ÿ
              .ÿgenerateÿdoubleÿxbÿ=ÿpid_uÿ+ÿtipÿ+ÿtdp

              .ÿgrologitÿxb,ÿgenerate(rsp)ÿcuts(`=logit(1/3)'ÿ`=logit(2/3)')

              .ÿ
              .ÿmeologitÿrspÿc.t?pÿi.timÿ||ÿpid:ÿ,ÿnolrtestÿnolog

              Mixed-effectsÿologitÿregressionÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿNumberÿofÿobsÿÿÿÿÿ=ÿÿÿÿÿÿ1,250
              Groupÿvariable:ÿÿÿÿÿÿÿÿÿÿÿÿÿpidÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿNumberÿofÿgroupsÿÿ=ÿÿÿÿÿÿÿÿ250

              ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿObsÿperÿgroup:
              ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿminÿ=ÿÿÿÿÿÿÿÿÿÿ5
              ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿavgÿ=ÿÿÿÿÿÿÿÿ5.0
              ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿmaxÿ=ÿÿÿÿÿÿÿÿÿÿ5

              Integrationÿmethod:ÿmvaghermiteÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿIntegrationÿpts.ÿÿ=ÿÿÿÿÿÿÿÿÿÿ7

              ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿWaldÿchi2(6)ÿÿÿÿÿÿ=ÿÿÿÿÿÿ55.93
              Logÿlikelihoodÿ=ÿ-1297.3467ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿProbÿ>ÿchi2ÿÿÿÿÿÿÿ=ÿÿÿÿÿ0.0000
              ------------------------------------------------------------------------------
              ÿÿÿÿÿÿÿÿÿrspÿ|ÿÿÿÿÿÿCoef.ÿÿÿStd.ÿErr.ÿÿÿÿÿÿzÿÿÿÿP>|z|ÿÿÿÿÿ[95%ÿConf.ÿInterval]
              -------------+----------------------------------------------------------------
              ÿÿÿÿÿÿÿÿÿtipÿ|ÿÿÿÿÿ.89297ÿÿÿ.2748363ÿÿÿÿÿ3.25ÿÿÿ0.001ÿÿÿÿÿ.3543007ÿÿÿÿ1.431639
              ÿÿÿÿÿÿÿÿÿtdpÿ|ÿÿÿ1.341377ÿÿÿ.2128365ÿÿÿÿÿ6.30ÿÿÿ0.000ÿÿÿÿÿ.9242248ÿÿÿÿ1.758529
              ÿÿÿÿÿÿÿÿÿÿÿÿÿ|
              ÿÿÿÿÿÿÿÿÿtimÿ|
              ÿÿÿÿÿÿÿÿÿÿ2ÿÿ|ÿÿ-.2653405ÿÿÿ.1766803ÿÿÿÿ-1.50ÿÿÿ0.133ÿÿÿÿ-.6116275ÿÿÿÿ.0809465
              ÿÿÿÿÿÿÿÿÿÿ3ÿÿ|ÿÿ-.2064531ÿÿÿ.1756501ÿÿÿÿ-1.18ÿÿÿ0.240ÿÿÿÿ-.5507209ÿÿÿÿ.1378147
              ÿÿÿÿÿÿÿÿÿÿ4ÿÿ|ÿÿÿÿ-.18477ÿÿÿÿ.175603ÿÿÿÿ-1.05ÿÿÿ0.293ÿÿÿÿ-.5289455ÿÿÿÿ.1594056
              ÿÿÿÿÿÿÿÿÿÿ5ÿÿ|ÿÿÿ.1784107ÿÿÿ.1769789ÿÿÿÿÿ1.01ÿÿÿ0.313ÿÿÿÿ-.1684617ÿÿÿÿ.5252831
              -------------+----------------------------------------------------------------
              ÿÿÿÿÿÿÿ/cut1ÿ|ÿÿ-.6123643ÿÿÿ.1422003ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ-.8910717ÿÿÿ-.3336568
              ÿÿÿÿÿÿÿ/cut2ÿ|ÿÿÿ.8041103ÿÿÿ.1434303ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.5229922ÿÿÿÿ1.085228
              -------------+----------------------------------------------------------------
              pidÿÿÿÿÿÿÿÿÿÿ|
              ÿÿÿvar(_cons)|ÿÿÿÿ.889881ÿÿÿÿ.180535ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.5979213ÿÿÿÿ1.324402
              ------------------------------------------------------------------------------

              .ÿ
              .ÿ*
              .ÿ*ÿBeginÿhere
              .ÿ*
              .ÿ
              .ÿgenerateÿbyteÿrsp12ÿ=ÿrspÿ==ÿ3

              .ÿgenerateÿbyteÿrsp23ÿ=ÿrspÿ>ÿ1

              .ÿ
              .ÿgsemÿ(rsp12ÿ<-ÿc.t?pÿi.timÿM[pid])ÿ(rsp23ÿ<-ÿc.t?pÿi.timÿM[pid]),ÿlogitÿnolog

              GeneralizedÿstructuralÿequationÿmodelÿÿÿÿÿÿÿÿÿÿÿNumberÿofÿobsÿÿÿÿÿ=ÿÿÿÿÿÿ1,250

              Responseÿÿÿÿÿÿÿ:ÿrsp12
              Familyÿÿÿÿÿÿÿÿÿ:ÿBernoulli
              Linkÿÿÿÿÿÿÿÿÿÿÿ:ÿlogit

              Responseÿÿÿÿÿÿÿ:ÿrsp23
              Familyÿÿÿÿÿÿÿÿÿ:ÿBernoulli
              Linkÿÿÿÿÿÿÿÿÿÿÿ:ÿlogit

              Logÿlikelihoodÿ=ÿ-1466.9685

              ÿ(ÿ1)ÿÿ[rsp12]M[pid]ÿ=ÿ1
              ------------------------------------------------------------------------------
              ÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿÿÿÿÿÿCoef.ÿÿÿStd.ÿErr.ÿÿÿÿÿÿzÿÿÿÿP>|z|ÿÿÿÿÿ[95%ÿConf.ÿInterval]
              -------------+----------------------------------------------------------------
              rsp12ÿÿÿÿÿÿÿÿ|
              ÿÿÿÿÿÿÿÿÿtipÿ|ÿÿÿÿ1.10415ÿÿÿ.3284244ÿÿÿÿÿ3.36ÿÿÿ0.001ÿÿÿÿÿ.4604497ÿÿÿÿÿ1.74785
              ÿÿÿÿÿÿÿÿÿtdpÿ|ÿÿÿ1.663766ÿÿÿ.2572707ÿÿÿÿÿ6.47ÿÿÿ0.000ÿÿÿÿÿ1.159524ÿÿÿÿ2.168007
              ÿÿÿÿÿÿÿÿÿÿÿÿÿ|
              ÿÿÿÿÿÿÿÿÿtimÿ|
              ÿÿÿÿÿÿÿÿÿÿ2ÿÿ|ÿÿ-.3009301ÿÿÿ.2171642ÿÿÿÿ-1.39ÿÿÿ0.166ÿÿÿÿ-.7265641ÿÿÿÿÿ.124704
              ÿÿÿÿÿÿÿÿÿÿ3ÿÿ|ÿÿ-.2911247ÿÿÿ.2171108ÿÿÿÿ-1.34ÿÿÿ0.180ÿÿÿÿ-.7166541ÿÿÿÿ.1344046
              ÿÿÿÿÿÿÿÿÿÿ4ÿÿ|ÿÿ-.2713841ÿÿÿ.2162243ÿÿÿÿ-1.26ÿÿÿ0.209ÿÿÿÿ-.6951759ÿÿÿÿ.1524077
              ÿÿÿÿÿÿÿÿÿÿ5ÿÿ|ÿÿÿ.2978414ÿÿÿ.2110066ÿÿÿÿÿ1.41ÿÿÿ0.158ÿÿÿÿ-.1157238ÿÿÿÿ.7114066
              ÿÿÿÿÿÿÿÿÿÿÿÿÿ|
              ÿÿÿÿÿÿM[pid]ÿ|ÿÿÿÿÿÿÿÿÿÿ1ÿÿ(constrained)
              ÿÿÿÿÿÿÿÿÿÿÿÿÿ|
              ÿÿÿÿÿÿÿ_consÿ|ÿÿ-.8287595ÿÿÿ.1672195ÿÿÿÿ-4.96ÿÿÿ0.000ÿÿÿÿ-1.156504ÿÿÿ-.5010152
              -------------+----------------------------------------------------------------
              rsp23ÿÿÿÿÿÿÿÿ|
              ÿÿÿÿÿÿÿÿÿtipÿ|ÿÿÿÿ.821142ÿÿÿ.3453366ÿÿÿÿÿ2.38ÿÿÿ0.017ÿÿÿÿÿ.1442946ÿÿÿÿ1.497989
              ÿÿÿÿÿÿÿÿÿtdpÿ|ÿÿÿ1.339572ÿÿÿ.2494162ÿÿÿÿÿ5.37ÿÿÿ0.000ÿÿÿÿÿ.8507252ÿÿÿÿ1.828419
              ÿÿÿÿÿÿÿÿÿÿÿÿÿ|
              ÿÿÿÿÿÿÿÿÿtimÿ|
              ÿÿÿÿÿÿÿÿÿÿ2ÿÿ|ÿÿÿÿ-.31475ÿÿÿ.2093285ÿÿÿÿ-1.50ÿÿÿ0.133ÿÿÿÿ-.7250264ÿÿÿÿ.0955263
              ÿÿÿÿÿÿÿÿÿÿ3ÿÿ|ÿÿ-.1798366ÿÿÿ.2101773ÿÿÿÿ-0.86ÿÿÿ0.392ÿÿÿÿ-.5917766ÿÿÿÿ.2321033
              ÿÿÿÿÿÿÿÿÿÿ4ÿÿ|ÿÿ-.1392819ÿÿÿ.2106989ÿÿÿÿ-0.66ÿÿÿ0.509ÿÿÿÿ-.5522441ÿÿÿÿ.2736803
              ÿÿÿÿÿÿÿÿÿÿ5ÿÿ|ÿÿÿ.1089368ÿÿÿ.2125263ÿÿÿÿÿ0.51ÿÿÿ0.608ÿÿÿÿÿ-.307607ÿÿÿÿ.5254806
              ÿÿÿÿÿÿÿÿÿÿÿÿÿ|
              ÿÿÿÿÿÿM[pid]ÿ|ÿÿÿ1.133117ÿÿÿÿ.137394ÿÿÿÿÿ8.25ÿÿÿ0.000ÿÿÿÿÿ.8638301ÿÿÿÿ1.402405
              ÿÿÿÿÿÿÿÿÿÿÿÿÿ|
              ÿÿÿÿÿÿÿ_consÿ|ÿÿÿ.6647975ÿÿÿ.1700863ÿÿÿÿÿ3.91ÿÿÿ0.000ÿÿÿÿÿ.3314345ÿÿÿÿ.9981606
              -------------+----------------------------------------------------------------
              ÿÿvar(M[pid])|ÿÿÿ1.168052ÿÿÿ.2340581ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.7886703ÿÿÿÿ1.729931
              ------------------------------------------------------------------------------

              .ÿestimatesÿstoreÿFull

              .ÿ
              .ÿconstraintÿdefineÿ1ÿ_b[rsp12:tip]ÿ=ÿ_b[rsp23:tip]

              .ÿconstraintÿdefineÿ2ÿ_b[rsp12:tdp]ÿ=ÿ_b[rsp23:tdp]

              .ÿconstraintÿdefineÿ3ÿ_b[rsp12:2.tim]ÿ=ÿ_b[rsp23:2.tim]

              .ÿconstraintÿdefineÿ4ÿ_b[rsp12:3.tim]ÿ=ÿ_b[rsp23:3.tim]

              .ÿconstraintÿdefineÿ5ÿ_b[rsp12:4.tim]ÿ=ÿ_b[rsp23:4.tim]

              .ÿconstraintÿdefineÿ6ÿ_b[rsp12:5.tim]ÿ=ÿ_b[rsp23:5.tim]

              .ÿ
              .ÿquietlyÿgsemÿ(rsp12ÿ<-ÿc.t?pÿi.timÿM[pid])ÿ(rsp23ÿ<-ÿc.t?pÿi.timÿM[pid]),ÿ///
              >ÿÿÿÿÿÿÿÿÿlogitÿconstraints(1/6)

              .ÿlrtestÿFull

              Likelihood-ratioÿtestÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿLRÿchi2(6)ÿÿ=ÿÿÿÿÿÿ2.78
              (Assumption:ÿ.ÿnestedÿinÿFull)ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿProbÿ>ÿchi2ÿ=ÿÿÿÿ0.8358

              .ÿ
              .ÿexit

              endÿofÿdo-file


              .


              The code uses a command, grologit (attached), which creates ordered-categorical data that conforms to the proportional-odds / parallel-lines assumption.
              Attached Files

              Comment


              • #8
                Dear Joseph sir,
                I am using Stata 14 version , so this is not working obvious.But I want to know that will this command also work in panel data or should I write 'xtgrologit' ?

                Comment


                • #9
                  Originally posted by priya sawaliya View Post
                  I am using Stata 14 version , so this is not working obvious.But I want to know that will this command also work in panel data or should I write 'xtgrologit' ?
                  Forget xtgrologit. As I said, start at the "Begin here" comment.

                  gsem I thought was available in Stata's Release 14, and so you should be able to scan through each of the regression coefficient pairs side-by-side and judge whether their difference is something that you need to start fretting over.

                  Comment

                  Working...
                  X