Announcement

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

  • how can we check association b/w an ordinal and categorical variable with four categories

    how can we check relationship b/w an ordinal and categorical variable with 4 categories? i have a variable with satisfaction score from 1-5, and other variable is distance from home like 1) <5km 2) 5-10km 3)10-15km 4) >15km
    1. chi square is for categorical
    2. spearman rank correlation is for ordinal, can someone help me with this?

  • #2
    Kusum:
    the -ologit- entry, Stata .pdf manual suggest something along the following lines:
    Code:
    . use "C:\Program Files\Stata17\ado\base\a\auto.dta"
    (1978 automobile data)
    
    . tabulate rep78 foreign, chi2
    
        Repair |
        record |      Car origin
          1978 |  Domestic    Foreign |     Total
    -----------+----------------------+----------
             1 |         2          0 |         2 
             2 |         8          0 |         8 
             3 |        27          3 |        30 
             4 |         9          9 |        18 
             5 |         2          9 |        11 
    -----------+----------------------+----------
         Total |        48         21 |        69 
    
              Pearson chi2(4) =  27.2640   Pr = 0.000
    
    . ologit rep78 i.foreign
    
    Iteration 0:   log likelihood = -93.692061  
    Iteration 1:   log likelihood = -79.696089  
    Iteration 2:   log likelihood = -79.034005  
    Iteration 3:   log likelihood = -79.029244  
    Iteration 4:   log likelihood = -79.029243  
    
    Ordered logistic regression                             Number of obs =     69
                                                            LR chi2(1)    =  29.33
                                                            Prob > chi2   = 0.0000
    Log likelihood = -79.029243                             Pseudo R2     = 0.1565
    
    ------------------------------------------------------------------------------
           rep78 | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
    -------------+----------------------------------------------------------------
         foreign |
        Foreign  |    2.98155   .6203644     4.81   0.000     1.765658    4.197442
    -------------+----------------------------------------------------------------
           /cut1 |  -3.158382   .7224269                     -4.574313   -1.742452
           /cut2 |  -1.362642   .3557343                     -2.059868   -.6654154
           /cut3 |   1.232161   .3431227                      .5596532     1.90467
           /cut4 |   3.246209   .5556657                      2.157124    4.335293
    ------------------------------------------------------------------------------
    
    .
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      thanks for the quick response Carlo Lazzaro, i have included my output, but for chi^2, p value is significant but for ologit it's not, what could be the possible reason for that?



      Code:
       ta  Q18 Q13, chi
      
         18. How |
       satisfied |
         are you |
       with your |
       treatment |
              at |
        
      Mohalla |
       Clinic on |
      a scale of |   13. How far is the Mohalla 
      Clinic from your home?
               1 |    1-2 km     2-5 km    5-10 km     5-10km      <1 km |     Total
      -----------+-------------------------------------------------------+----------
               1 |         0          0          1          1          0 |         2 
               2 |         4         10          0          0          3 |        17 
               3 |        46         60          3         11         17 |       137 
               4 |        66         42          2          8         24 |       142 
               5 |        47         35          3          4         13 |       102 
      -----------+-------------------------------------------------------+----------
           Total |       163        147          9         24         57 |       400 
      
               Pearson chi2(16) =  44.7348   Pr = 0.000
      
      . ologit Q18 i.Q13
      
      Iteration 0:   log likelihood = -497.52284  
      Iteration 1:   log likelihood = -493.23756  
      Iteration 2:   log likelihood =  -493.2324  
      Iteration 3:   log likelihood =  -493.2324  
      
      Ordered logistic regression                             Number of obs =    400
                                                              LR chi2(4)    =   8.58
                                                              Prob > chi2   = 0.0725
      Log likelihood = -493.2324                              Pseudo R2     = 0.0086
      
      ------------------------------------------------------------------------------
               Q18 | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
      -------------+----------------------------------------------------------------
               Q13 |
           2-5 km  |  -.5607657   .2107533    -2.66   0.008    -.9738346   -.1476969
          5-10 km  |  -.3627827   .6804225    -0.53   0.594    -1.696386    .9708208
           5-10km  |  -.7165465   .3989188    -1.80   0.072    -1.498413    .0653199
            <1 km  |  -.2549347     .27705    -0.92   0.357    -.7979427    .2880733
      -------------+----------------------------------------------------------------
             /cut1 |  -5.621641   .7200313                     -7.032877   -4.210406
             /cut2 |  -3.322487   .2659922                     -3.843822   -2.801152
             /cut3 |  -.7400257   .1517087                     -1.037369   -.4426822
             /cut4 |   .8042331   .1530726                      .5042163     1.10425
      ------------------------------------------------------------------------------

      Comment


      • #4
        and if I'm not wrong, one of the assumption for chi square is that each cell must contain atleast 5 observations

        Comment


        • #5
          Kusum:
          1) what if you go -testparm i.Q13-?;
          2) correct. You can go -Fisher- exact test:
          Code:
          . tabulate rep78 foreign, exact
          
          Enumerating sample-space combinations:
          stage 5:  enumerations = 1
          stage 4:  enumerations = 3
          stage 3:  enumerations = 24
          stage 2:  enumerations = 203
          stage 1:  enumerations = 0
          
              Repair |
              record |      Car origin
                1978 |  Domestic    Foreign |     Total
          -----------+----------------------+----------
                   1 |         2          0 |         2 
                   2 |         8          0 |         8 
                   3 |        27          3 |        30 
                   4 |         9          9 |        18 
                   5 |         2          9 |        11 
          -----------+----------------------+----------
               Total |        48         21 |        69 
          
                     Fisher's exact =                 0.000
          
          .
          Kind regards,
          Carlo
          (Stata 19.0)

          Comment


          • #6
            The chi2 test of association is the most general way how test whether the levels of two variables are independent.

            Comment


            • #7
              There are, it seems, some major problems here -- that fortunately are easily fixed.

              First, "< 1 km" is manifestly out of order.

              Second, it seems likely that there is a spurious distinction between "5-10 km" and "5-10km".

              My guess is that these problems arise from a careless encode. That command won't protect you from errors.

              Second, a common criterion for chi-square tests is that expected frequencies be at least 5, although in principle and practice frequencies with at least 1 seems to work quite well.

              After surgery the data look like this:

              Code:
              * Example generated by -dataex-. For more info, type help dataex
              clear
              input byte(score dist freq)
              1 1  0
              1 2  0
              1 3  0
              1 4  2
              2 1  3
              2 2  4
              2 3 10
              2 4  0
              3 1 17
              3 2 46
              3 3 60
              3 4 14
              4 1 24
              4 2 66
              4 3 42
              4 4 10
              5 1 13
              5 2 47
              5 3 35
              5 4  7
              end
              label values dist dist
              label def dist 1 "<1 km", modify
              label def dist 2 "1-2 km", modify
              label def dist 3 "2-5 km", modify
              label def dist 4 "5-10 km", modify
              I ran tabchi from tab_chi on SSC and floatplot from SSC.

              Code:
              tabchi score dist [w=freq]
              
              (frequency weights assumed)
              
                        observed frequency
                        expected frequency
              
              ----------------------------------------------
                        |                dist              
                  score |   <1 km   1-2 km   2-5 km  5-10 km
              ----------+-----------------------------------
                      1 |       0        0        0        2
                        |   0.285    0.815    0.735    0.165
                        |
                      2 |       3        4       10        0
                        |   2.422    6.928    6.247    1.403
                        |
                      3 |      17       46       60       14
                        |  19.523   55.828   50.347   11.303
                        |
                      4 |      24       66       42       10
                        |  20.235   57.865   52.185   11.715
                        |
                      5 |      13       47       35        7
                        |  14.535   41.565   37.485    8.415
              ----------------------------------------------
              
              6 cells with expected frequency < 5
              4 cells with expected frequency < 1
              
                        Pearson chi2(12) =  37.1824   Pr = 0.000
               likelihood-ratio chi2(12) =  26.2208   Pr = 0.010

              A more cautious approach would merge scores 1 and 2, but that looks convincing to me as indicating an association.

              The real question is what is the nature of that association. A graph never does any harm.


              Code:
              label var dist "distance to clinic"
              
              floatplot score [w=freq], over(dist) fcolors(red*0.6 red*0.2 blue*0.2 blue*0.6 blue) centre(3) vertical lcolors(red red blue blue blue)
              Click image for larger version

Name:	floatplot2.png
Views:	1
Size:	17.3 KB
ID:	1695459


              Nothing rules out a logit fit too. More serious is what other mess is to be found if encode was applied carelessly to other variables.
              Last edited by Nick Cox; 31 Dec 2022, 04:46.

              Comment


              • #8
                FWIW. especially if you live and die by P < 0.05, the ordinal logit is better once the data are fixed

                I am tempted to see fine structure in the graph that the model won't catch so well. For example, is there a notable shift at around 2 km? Perhaps many people are willing to walk or cycle 2 km, but beyond that is a bigger deal. Depends a great deal on who is being surveyed, and how mobile they are in all senses.

                Comment


                • #9
                  thank you Nick Cox for the identifying the mistake i made using "encode". i'll surely check for other variables as well
                  but as you said score 1&2 can be merged, but what if i don't want to merge these satisfaction score
                  can i still use chi square?
                  and for fisher exact, some memory exceeded error is coming

                  Code:
                  . ta  Q18 Q13, exact
                  
                  Enumerating sample-space combinations:
                  stage 5:  enumerations = 1
                  stage 4:  enumerations = 10
                  stage 3:  enumerations = 5038
                  stage 2:
                  exceeded memory limits using exact(1); try again with larger #; see help tabulate for details
                  
                     18. How |
                   satisfied |
                     are you |
                   with your |
                   treatment |
                          at |
                    
                  Mohalla |
                   Clinic on |  RECODE of Q13 (13. How far is the Mohalla
                  a scale of |          
                  Clinic from your home?)
                           1 |      <1km      1-2km      2-5km     5-10km |     Total
                  -----------+--------------------------------------------+----------
                           1 |         0          0          0          2 |         2 
                           2 |         3          4         10          0 |        17 
                           3 |        17         46         60         14 |       137 
                           4 |        24         66         42         10 |       142 
                           5 |        13         47         35          7 |       102 
                  -----------+--------------------------------------------+----------
                       Total |        57        163        147         33 |       400 
                  
                  r(910);

                  Comment


                  • #10
                    i tried the combination of these Independent variables. hoping I'm doing it correct now



                    Code:
                     tab1 Q18 Q13 Q14 Q15 Q16 Q17
                    
                    -> tabulation of Q18
                    
                        18. How |
                      satisfied |
                        are you |
                      with your |
                      treatment |
                    at 
                    Mohalla |
                    Clinic on a |
                     scale of 1 |      Freq.     Percent        Cum.
                    ------------+-----------------------------------
                              1 |          2        0.50        0.50
                              2 |         17        4.25        4.75
                              3 |        137       34.25       39.00
                              4 |        142       35.50       74.50
                              5 |        102       25.50      100.00
                    ------------+-----------------------------------
                          Total |        400      100.00
                    
                    
                    -> tabulation of Q13  
                    
                      RECODE of |
                       Q13 (13. |
                     How far is |
                    the Mohalla |
                        
                    Clinic |
                      from your |
                         home?) |      Freq.     Percent        Cum.
                    ------------+-----------------------------------
                           <1km |         57       14.25       14.25
                          1-2km |        163       40.75       55.00
                          2-5km |        147       36.75       91.75
                         5-10km |         33        8.25      100.00
                    ------------+-----------------------------------
                          Total |        400      100.00
                    
                    -> tabulation of Q14  
                    
                             14. How |
                       frequently do |
                          you go for |
                     consulting 
                    the |
                     doctor for your |
                     diabetes treatm |      Freq.     Percent        Cum.
                    -----------------+-----------------------------------
                     every 7-15 days |        112       28.00       28.00
                         every month |        201       50.25       78.25
                    once in 3 months |         87       21.75      100.00
                    -----------------+-----------------------------------
                               Total |        400      100.00
                    
                    -> tabulation of Q15  
                    
                     15. Do you |
                        need to |
                         take a |
                          prior |
                    appointment |
                     
                    or do you |
                    walk-in for |
                    consultatio |
                             n? |      Freq.     Percent        Cum.
                    ------------+-----------------------------------
                    appointment |         88       22.00       22.00
                        walk-in |        312       78.00      100.00
                    ------------+-----------------------------------
                          Total |        400      100.00
                    
                    -> tabulation of Q16  
                    
                      RECODE of |
                    Q16 (16. On |
                    an average, |
                    how long do |
                    you need to |
                        wait to |
                      
                    see your |
                           doct |      Freq.     Percent        Cum.
                    ------------+-----------------------------------
                       <15 mins |        183       45.75       45.75
                     15-30 mins |        206       51.50       97.25
                     30mins-1hr |         11        2.75      100.00
                    ------------+-----------------------------------
                          Total |        400      100.00
                    
                    -> tabulation of Q17  
                    
                      RECODE of |
                    Q17 (17. On |
                     an average |
                       how much |
                      time does |
                       he spend |
                           
                    for |
                    consultatio |
                            n f |      Freq.     Percent        Cum.
                    ------------+-----------------------------------
                        <5 mins |         82       20.50       20.50
                       5-10mins |        117       29.25       49.75
                      10-20mins |        156       39.00       88.75
                       >20 mins |         45       11.25      100.00
                    ------------+-----------------------------------
                          Total |        400      100.00
                    
                    . ologit Q18 i.Q13 i.Q14 i.Q15 i.Q16 i.Q17
                    
                    Iteration 0:   log likelihood = -497.52284  
                    Iteration 1:   log likelihood = -481.67219  
                    Iteration 2:   log likelihood = -481.59542  
                    Iteration 3:   log likelihood = -481.59538  
                    
                    Ordered logistic regression                             Number of obs =    400
                                                                            LR chi2(11)   =  31.85
                                                                            Prob > chi2   = 0.0008
                    Log likelihood = -481.59538                             Pseudo R2     = 0.0320
                    
                    -----------------------------------------------------------------------------------
                                  Q18 | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
                    ------------------+----------------------------------------------------------------
                                  Q13 |
                               1-2km  |   .1822775   .2836583     0.64   0.520    -.3736825    .7382375
                               2-5km  |  -.0989544   .3377742    -0.29   0.770    -.7609798    .5630709
                              5-10km  |  -.0957457   .4523877    -0.21   0.832    -.9824094    .7909179
                                      |
                                  Q14 |
                         every month  |   .4912631   .2504297     1.96   0.050     .0004299    .9820964
                    once in 3 months  |   1.072121   .3078421     3.48   0.000     .4687613     1.67548
                                      |
                                  Q15 |
                             walk-in  |  -.5169155   .2555246    -2.02   0.043    -1.017735   -.0160964
                                      |
                                  Q16 |
                          15-30 mins  |  -.0819063    .192771    -0.42   0.671    -.4597306    .2959179
                          30mins-1hr  |  -.2450428   .7186659    -0.34   0.733    -1.653602    1.163517
                                      |
                                  Q17 |
                            5-10mins  |   .3171456   .3323564     0.95   0.340     -.334261    .9685523
                           10-20mins  |   .4906557      .2606     1.88   0.060    -.0201109    1.001422
                            >20 mins  |  -.1959378   .3984827    -0.49   0.623    -.9769495    .5850739
                    ------------------+----------------------------------------------------------------
                                /cut1 |  -5.114562   .8446824                     -6.770109   -3.459015
                                /cut2 |  -2.800087   .5135582                     -3.806642   -1.793531
                                /cut3 |  -.1355627   .4683834                     -1.053577    .7824519
                                /cut4 |   1.478066   .4756921                      .5457264    2.410405
                    -----------------------------------------------------------------------------------
                    
                    .

                    Comment


                    • #11
                      The deal about low expected frequencies is to check that a low P-value isn’t just a side-effect but that you get consistent results both with and without pooling cells.

                      The problem with throwing many predictors into your model is coping with relationships between them, such as between time and distance.

                      Comment


                      • #12
                        Originally posted by kusum shekhawat View Post
                        how can we check relationship b/w an ordinal and categorical variable with 4 categories? i have a variable with satisfaction score from 1-5, and other variable is distance from home like 1) <5km 2) 5-10km 3)10-15km 4) >15km
                        1. chi square is for categorical
                        2. spearman rank correlation is for ordinal, can someone help me with this?
                        Personally, I would recommend a chi-squared test if your only interest is in a bivariate relationship. The ordered logit model involves the assumption of proportional odds, whereas the chi-squared test makes no such assumption and will effectively regard each value of each variable as its own category. Its results (i.e., the cross-tab) can also be far more informative than the single coefficient you will get from an ologit model.

                        If you want to add controls, then that's a different story, but if it's just a bivariate relationship that you are interested in, the chi-squared test is the safest and most useful, in my view. (p.s., both of the variables you describe sound ordinal to me; neither is purely categorical as each has a natural ordering of values.)

                        Comment


                        • #13
                          Originally posted by John Kane View Post
                          both of the variables you describe sound ordinal to me; neither is purely categorical as each has a natural ordering of values.
                          To me, too. If the OP is interested in assessing the degree of association between these two ordered-categorical variables, then consider -tabulate- with its two measures of ordinal association, as illustrated below (using Nick's cleaned up dataset from #7 above).

                          OP can also fit an ordered-categorical regression model with the two variables, especially, if the assumption of exogeneity of distance is tenable; even so, -contrast- can give a measure of association in its linear component of the set of orthogonal polynomial contrasts (also illustrated below). With both envisioned as purely outcome variables, then perhaps something like a bivariate ordered-probit model could be helpful.

                          .ÿ
                          .ÿversionÿ17.0

                          .ÿ
                          .ÿclearÿ*

                          .ÿ
                          .ÿquietlyÿinputÿbyte(satÿdisÿcount)

                          .ÿlabelÿdefineÿDistancesÿ1ÿ"<1ÿkm"ÿ2ÿ"1-2ÿkm"ÿ3ÿ"2-5ÿkm"ÿ4ÿ"5-10ÿkm"

                          .ÿlabelÿvaluesÿdisÿDistances

                          .ÿ
                          .ÿtabulateÿsatÿdisÿ[fweight=count],ÿgammaÿtaub

                          ÿÿÿÿÿÿÿÿÿÿÿ|ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿdis
                          ÿÿÿÿÿÿÿsatÿ|ÿÿÿÿÿ<1ÿkmÿÿÿÿÿ1-2ÿkmÿÿÿÿÿ2-5ÿkmÿÿÿÿ5-10ÿkmÿ|ÿÿÿÿÿTotal
                          -----------+--------------------------------------------+----------
                          ÿÿÿÿÿÿÿÿÿ1ÿ|ÿÿÿÿÿÿÿÿÿ0ÿÿÿÿÿÿÿÿÿÿ0ÿÿÿÿÿÿÿÿÿÿ0ÿÿÿÿÿÿÿÿÿÿ2ÿ|ÿÿÿÿÿÿÿÿÿ2ÿ
                          ÿÿÿÿÿÿÿÿÿ2ÿ|ÿÿÿÿÿÿÿÿÿ3ÿÿÿÿÿÿÿÿÿÿ4ÿÿÿÿÿÿÿÿÿ10ÿÿÿÿÿÿÿÿÿÿ0ÿ|ÿÿÿÿÿÿÿÿ17ÿ
                          ÿÿÿÿÿÿÿÿÿ3ÿ|ÿÿÿÿÿÿÿÿ17ÿÿÿÿÿÿÿÿÿ46ÿÿÿÿÿÿÿÿÿ60ÿÿÿÿÿÿÿÿÿ14ÿ|ÿÿÿÿÿÿÿ137ÿ
                          ÿÿÿÿÿÿÿÿÿ4ÿ|ÿÿÿÿÿÿÿÿ24ÿÿÿÿÿÿÿÿÿ66ÿÿÿÿÿÿÿÿÿ42ÿÿÿÿÿÿÿÿÿ10ÿ|ÿÿÿÿÿÿÿ142ÿ
                          ÿÿÿÿÿÿÿÿÿ5ÿ|ÿÿÿÿÿÿÿÿ13ÿÿÿÿÿÿÿÿÿ47ÿÿÿÿÿÿÿÿÿ35ÿÿÿÿÿÿÿÿÿÿ7ÿ|ÿÿÿÿÿÿÿ102ÿ
                          -----------+--------------------------------------------+----------
                          ÿÿÿÿÿTotalÿ|ÿÿÿÿÿÿÿÿ57ÿÿÿÿÿÿÿÿ163ÿÿÿÿÿÿÿÿ147ÿÿÿÿÿÿÿÿÿ33ÿ|ÿÿÿÿÿÿÿ400ÿ

                          ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿgammaÿ=ÿÿ-0.1410ÿÿASEÿ=ÿ0.063
                          ÿÿÿÿÿÿÿÿÿÿKendall'sÿtau-bÿ=ÿÿ-0.0966ÿÿASEÿ=ÿ0.043

                          .ÿ
                          .ÿ//ÿAlternatively:
                          .ÿoprobitÿsatÿi.disÿ[fweight=count],ÿnolog

                          OrderedÿprobitÿregressionÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿNumberÿofÿobsÿ=ÿÿÿÿ400
                          ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿLRÿchi2(3)ÿÿÿÿ=ÿÿÿ8.72
                          ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿProbÿ>ÿchi2ÿÿÿ=ÿ0.0332
                          Logÿlikelihoodÿ=ÿ-493.16255ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿPseudoÿR2ÿÿÿÿÿ=ÿ0.0088

                          ------------------------------------------------------------------------------
                          ÿÿÿÿÿÿÿÿÿsatÿ|ÿCoefficientÿÿStd.ÿerr.ÿÿÿÿÿÿzÿÿÿÿP>|z|ÿÿÿÿÿ[95%ÿconf.ÿinterval]
                          -------------+----------------------------------------------------------------
                          ÿÿÿÿÿÿÿÿÿdisÿ|
                          ÿÿÿÿÿ1-2ÿkmÿÿ|ÿÿÿ.1678972ÿÿÿ.1656551ÿÿÿÿÿ1.01ÿÿÿ0.311ÿÿÿÿ-.1567808ÿÿÿÿ.4925753
                          ÿÿÿÿÿ2-5ÿkmÿÿ|ÿÿ-.1564596ÿÿÿ.1677763ÿÿÿÿ-0.93ÿÿÿ0.351ÿÿÿÿ-.4852951ÿÿÿÿ.1723759
                          ÿÿÿÿ5-10ÿkmÿÿ|ÿÿ-.2535904ÿÿÿ.2354665ÿÿÿÿ-1.08ÿÿÿ0.281ÿÿÿÿ-.7150963ÿÿÿÿ.2079155
                          -------------+----------------------------------------------------------------
                          ÿÿÿÿÿÿÿ/cut1ÿ|ÿÿ-2.636018ÿÿÿÿ.284971ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ-3.19455ÿÿÿ-2.077485
                          ÿÿÿÿÿÿÿ/cut2ÿ|ÿÿ-1.703393ÿÿÿ.1712943ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ-2.039124ÿÿÿ-1.367662
                          ÿÿÿÿÿÿÿ/cut3ÿ|ÿÿ-.2903858ÿÿÿ.1461425ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ-.5768199ÿÿÿ-.0039517
                          ÿÿÿÿÿÿÿ/cut4ÿ|ÿÿÿ.6584628ÿÿÿ.1479854ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.3684167ÿÿÿÿ.9485088
                          ------------------------------------------------------------------------------

                          .ÿcontrastÿqw.dis,ÿasobservedÿnoeffectsÿ//ÿlinearÿassociationÿisÿtheÿfirstÿrow

                          Contrastsÿofÿmarginalÿlinearÿpredictions

                          Margins:ÿasobserved

                          ------------------------------------------------
                          ÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿÿÿÿÿÿÿÿÿdfÿÿÿÿÿÿÿÿchi2ÿÿÿÿÿP>chi2
                          -------------+----------------------------------
                          satÿÿÿÿÿÿÿÿÿÿ|
                          ÿÿÿÿÿÿÿÿÿdisÿ|
                          ÿÿÿ(linear)ÿÿ|ÿÿÿÿÿÿÿÿÿÿ1ÿÿÿÿÿÿÿÿ4.54ÿÿÿÿÿ0.0330
                          (quadratic)ÿÿ|ÿÿÿÿÿÿÿÿÿÿ1ÿÿÿÿÿÿÿÿ1.57ÿÿÿÿÿ0.2096
                          ÿÿÿÿ(cubic)ÿÿ|ÿÿÿÿÿÿÿÿÿÿ1ÿÿÿÿÿÿÿÿ2.70ÿÿÿÿÿ0.1006
                          ÿÿÿÿÿÿJointÿÿ|ÿÿÿÿÿÿÿÿÿÿ3ÿÿÿÿÿÿÿÿ8.70ÿÿÿÿÿ0.0336
                          ------------------------------------------------

                          .ÿ
                          .ÿ//ÿOtherwise,ÿmaybeÿconsiderÿsomethingÿalongÿtheÿfollowingÿlines
                          .ÿquietlyÿdropÿifÿ!count

                          .ÿquietlyÿexpandÿcount

                          .ÿgsemÿ(sat@1ÿ<-ÿF1,ÿoprobit)ÿ(dis@1ÿ<-ÿF2,ÿoprobit),ÿvariance(F1@1ÿF2@1)ÿ///
                          >ÿÿÿÿÿcovariance(F1*F2)ÿnocnsreportÿnoheaderÿnolog
                          ------------------------------------------------------------------------------
                          ÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿCoefficientÿÿStd.ÿerr.ÿÿÿÿÿÿzÿÿÿÿP>|z|ÿÿÿÿÿ[95%ÿconf.ÿinterval]
                          -------------+----------------------------------------------------------------
                          satÿÿÿÿÿÿÿÿÿÿ|
                          ÿÿÿÿÿÿÿÿÿÿF1ÿ|ÿÿÿÿÿÿÿÿÿÿ1ÿÿ(constrained)
                          -------------+----------------------------------------------------------------
                          disÿÿÿÿÿÿÿÿÿÿ|
                          ÿÿÿÿÿÿÿÿÿÿF2ÿ|ÿÿÿÿÿÿÿÿÿÿ1ÿÿ(constrained)
                          -------------+----------------------------------------------------------------
                          /satÿÿÿÿÿÿÿÿÿ|
                          ÿÿÿÿÿÿÿÿcut1ÿ|ÿÿ-3.663671ÿÿÿ.3513755ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ-4.352354ÿÿÿ-2.974988
                          ÿÿÿÿÿÿÿÿcut2ÿ|ÿÿ-2.361907ÿÿÿ.1518846ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ-2.659595ÿÿÿ-2.064219
                          ÿÿÿÿÿÿÿÿcut3ÿ|ÿÿ-.3927769ÿÿÿ.0899474ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ-.5690705ÿÿÿ-.2164834
                          ÿÿÿÿÿÿÿÿcut4ÿ|ÿÿÿ.9330804ÿÿÿ.0958584ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.7452014ÿÿÿÿ1.120959
                          -------------+----------------------------------------------------------------
                          /disÿÿÿÿÿÿÿÿÿ|
                          ÿÿÿÿÿÿÿÿcut1ÿ|ÿÿ-1.512085ÿÿÿ.1095182ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ-1.726736ÿÿÿ-1.297433
                          ÿÿÿÿÿÿÿÿcut2ÿ|ÿÿÿ.1757111ÿÿÿ.0889448ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.0013826ÿÿÿÿ.3500396
                          ÿÿÿÿÿÿÿÿcut3ÿ|ÿÿÿÿ1.96634ÿÿÿ.1278867ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ1.715687ÿÿÿÿ2.216994
                          -------------+----------------------------------------------------------------
                          ÿÿÿÿÿÿvar(F1)|ÿÿÿÿÿÿÿÿÿÿ1ÿÿ(constrained)
                          ÿÿÿÿÿÿvar(F2)|ÿÿÿÿÿÿÿÿÿÿ1ÿÿ(constrained)
                          -------------+----------------------------------------------------------------
                          ÿÿÿcov(F1,F2)|ÿÿ-.2389781ÿÿÿ.1140519ÿÿÿÿ-2.10ÿÿÿ0.036ÿÿÿÿ-.4625157ÿÿÿ-.0154405
                          ------------------------------------------------------------------------------

                          .ÿassertÿe(converged)

                          .ÿ
                          .ÿexit

                          endÿofÿdo-file


                          .

                          Comment

                          Working...
                          X