-----------------------------------------------------------------------------------------------------

      name:  <unnamed>

       log:  C:\Users\mexmi\Documents\newer web pages\Soc_382\logs\2nd loglin intermar class.log

  log type:  text

 opened on:  31 Jan 2019, 10:18:08

 

* Before class I was creating the crossings parameters, which I did not get to explain in class (and will next class).

 

. * replace cross1=1 if (meth_num==1 & feth_num>1) | (feth_num==1& meth_num>1)

 

. gen cross1=0

 

. replace cross1=1 if (meth_num==1 & feth_num>1) | (feth_num==1& meth_num>1)

(8 real changes made)

 

. gen cross2=0

 

. replace cross2=1 if (meth_num<=2 & feth_num>2)| (feth_num<=2 & meth_num>2)

(12 real changes made)

 

. gen cross3=0

 

. replace cross3=1 if (meth_num<=3 & feth_num>3)| (feth_num<=3 & meth_num>3)

(12 real changes made)

 

. gen cross4=0

 

. replace cross4=1 if (meth_num<=4 & feth_num>4)| (feth_num<=4 & meth_num>4)

(8 real changes made)

 

. poisson count i.meth_num i.feth_num i.cross*

 

Iteration 0:   log likelihood = -1628492.6 

Iteration 1:   log likelihood = -514542.18  (backed up)

Iteration 2:   log likelihood = -405521.33  (backed up)

Iteration 3:   log likelihood = -241959.01  (backed up)

Iteration 4:   log likelihood = -147645.83 

Iteration 5:   log likelihood = -59259.102 

Iteration 6:   log likelihood = -12308.206 

Iteration 7:   log likelihood = -10257.604 

Iteration 8:   log likelihood =  -10246.31 

Iteration 9:   log likelihood = -10246.309 

 

Poisson regression                                Number of obs   =         25

                                                  LR chi2(12)     = 3132470.69

                                                  Prob > chi2     =     0.0000

Log likelihood = -10246.309                       Pseudo R2       =     0.9935

 

-------------------------------------------------------------------------------------

              count |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]

--------------------+----------------------------------------------------------------

           meth_num |

  Mexican American  |   -.977803   .0181359   -53.92   0.000    -1.013349   -.9422572

    Hispanic Other  |  -1.938943    .020284   -95.59   0.000    -1.978698   -1.899187

Non Hispanic Other  |  -2.506451   .0216409  -115.82   0.000    -2.548866   -2.464035

White non Hispanic  |   .6765227   .0185343    36.50   0.000     .6401961    .7128493

                    |

           feth_num |

  Mexican American  |  -.0199891    .018195    -1.10   0.272    -.0556507    .0156725

    Hispanic Other  |  -.8181779   .0202753   -40.35   0.000    -.8579168    -.778439

Non Hispanic Other  |  -1.107257   .0209967   -52.73   0.000     -1.14841   -1.066104

White non Hispanic  |   1.871097   .0185343   100.95   0.000      1.83477    1.907423

                    |

           1.cross1 |  -3.026666    .017803  -170.01   0.000    -3.061559   -2.991773

           1.cross2 |  -1.014698   .0101682   -99.79   0.000    -1.034627   -.9947684

           1.cross3 |  -.5411649   .0113079   -47.86   0.000     -.563328   -.5190018

           1.cross4 |  -1.444942   .0092927  -155.49   0.000    -1.463155   -1.426728

              _cons |   10.65775   .0048495  2197.69   0.000     10.64825    10.66726

-------------------------------------------------------------------------------------

 

. poisgof

 

         Deviance goodness-of-fit =  20262.62

         Prob > chi2(12)          =    0.0000

 

         Pearson goodness-of-fit  =  21598.27

         Prob > chi2(12)          =    0.0000

 

* We started class here, talking about where the Quasi-independence model fit the data, and where it didn’t.

 

. table meth_num feth_num, contents(sum count sum quasi_indep_model) row col cellwidth(10)

 

--------------------------------------------------------------------------------------------

husband's           |                         wife's race/ethnicity                        

race/ethnicity      | Black, non  Mexican Am  Hispanic O  Non Hispan  White non        Total

--------------------+-----------------------------------------------------------------------

Black, non Hispanic |      42521         291         412         393        2064       45681

                    |      42521    274.1622    229.8974    264.6786    2391.262       45681

                    |

   Mexican American |         94       18088         612         433        6067       25294

                    |   108.2118       18088    565.4383    650.9836    5881.366       25294

                    |

     Hispanic Other |        310         633        5901         258        4507       11609

                    |   84.44069    526.1821        5901    507.9809    4589.396       11609

                    |

 Non Hispanic Other |        101         317         214        3509        3959        8100

                    |   68.72013    428.2213    359.0829        3509    3734.976        8100

                    |

 White non Hispanic |        615        5338        4403        5505      543276      559137

                    |   858.6274    5350.435    4486.582    5165.357      543276      559137

                    |

              Total |      43641       24667       11542       10098      559873      649821

                    |      43641       24667       11542       10098      559873      649821

--------------------------------------------------------------------------------------------

 

* I generated the cell-by-cell pearson chisquare statistic, in order to figure out which cells fit the data worst by the quasi-symmetry model. Since the Pearson statistic is positive everywhere, it is more useful on a cell-by-cell basis than the LR chisquare statistic, which is positive in some cells and negative in others.

 

. gen pearson_quasi_indep=((count- quasi_indep_model)^2)/ quasi_indep_model

 

. table meth_num feth_num, contents(sum count sum quasi_indep_model sum pearson_quasi_indep ) row col cellwidth(10)

 

--------------------------------------------------------------------------------------------

husband's           |                         wife's race/ethnicity                        

race/ethnicity      | Black, non  Mexican Am  Hispanic O  Non Hispan  White non        Total

--------------------+-----------------------------------------------------------------------

Black, non Hispanic |      42521         291         412         393        2064       45681

                    |      42521    274.1622    229.8974    264.6786    2391.262       45681

                    |          0    1.034097    144.2441    62.21268    44.78817     252.279

                    |

   Mexican American |         94       18088         612         433        6067       25294

                    |   108.2118       18088    565.4383    650.9836    5881.366       25294

                    |    1.86647           0    3.834181    72.99238    5.859167     84.5522

                    |

     Hispanic Other |        310         633        5901         258        4507       11609

                    |   84.44069    526.1821        5901    507.9809    4589.396       11609

                    |   602.5176    21.68462           0    123.0173    1.479319    748.6989

                    |

 Non Hispanic Other |        101         317         214        3509        3959        8100

                    |   68.72013    428.2213    359.0829        3509    3734.976        8100

                    |    15.1628    28.88735    58.61894           0    13.43702    116.1061

                    |

 White non Hispanic |        615        5338        4403        5505      543276      559137

                    |   858.6274    5350.435    4486.582    5165.357      543276      559137

                    |   69.12699    .0288983     1.55706     22.3329           0    93.04585

                    |

              Total |      43641       24667       11542       10098      559873      649821

                    |      43641       24667       11542       10098      559873      649821

                    |   688.6739    51.63497    208.2543    280.5553    65.56367    1294.682

--------------------------------------------------------------------------------------------

 

* Looking at this table, we see that cells 1,3 and 3,1 (black-other Hispanic intermarriage) contribute a lot to the total Pearson chisquare statistic of 1294.

 

. codebook meth_num

 

-----------------------------------------------------------------------------------------------------

meth_num                                                                     husband's race/ethnicity

-----------------------------------------------------------------------------------------------------

 

                  type:  numeric (byte)

                 label:  ethnicity

 

                 range:  [1,5]                        units:  1

         unique values:  5                        missing .:  0/25

 

            tabulation:  Freq.   Numeric  Label

                             5         1  Black, non Hispanic

                             5         2  Mexican American

                             5         3  Hispanic Other

                             5         4  Non Hispanic Other

                             5         5  White non Hispanic

 

* Now I generate the symmetric dummy variable to fit the two black-other Hispanic cells.

. gen byte black_othHisp=0

 

. replace black_othHisp=1 if (meth_num==1 & feth_num==3)|(feth_num==1 & meth_num==3)

(2 real changes made)

 

. *this is the gender symmetric black-Other Hispanic interaction.

 

. *Which we picked because the black-other Hispanic cells are fit poorly by quasi-symmetry

 

 

. poisson count i.meth_num i.feth_num i.endogamy_diagonal_cat

 

Iteration 0:   log likelihood = -1622248.5 

Iteration 1:   log likelihood = -451561.88  (backed up)

Iteration 2:   log likelihood = -374791.98  (backed up)

Iteration 3:   log likelihood = -199026.43  (backed up)

Iteration 4:   log likelihood =  -143118.6 

Iteration 5:   log likelihood = -64630.014 

Iteration 6:   log likelihood = -2062.1525 

Iteration 7:   log likelihood = -650.23659 

Iteration 8:   log likelihood = -648.54413 

Iteration 9:   log likelihood = -648.54411 

 

Poisson regression                                Number of obs   =         25

                                                  LR chi2(13)     = 3151666.22

                                                  Prob > chi2     =     0.0000

Log likelihood = -648.54411                       Pseudo R2       =     0.9996

 

---------------------------------------------------------------------------------------

                count |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]

----------------------+----------------------------------------------------------------

             meth_num |

    Mexican American  |    .899968   .0213908    42.07   0.000     .8580427    .9418932

      Hispanic Other  |   .6519274   .0222121    29.35   0.000     .6083924    .6954623

  Non Hispanic Other  |   .4459202   .0231596    19.25   0.000     .4005282    .4913121

  White non Hispanic  |   2.971213   .0235674   126.07   0.000     2.925022    3.017404

                      |

             feth_num |

    Mexican American  |   1.829598    .032363    56.53   0.000     1.766168    1.893028

      Hispanic Other  |   1.653511   .0327399    50.50   0.000     1.589342     1.71768

  Non Hispanic Other  |   1.794394   .0323429    55.48   0.000     1.731004    1.857785

  White non Hispanic  |   3.995454   .0336881   118.60   0.000     3.929427    4.061482

                      |

endogamy_diagonal_cat |

                   1  |   6.873631   .0370393   185.58   0.000     6.801036    6.946227

                   2  |   3.289316   .0229991   143.02   0.000     3.244239    3.334393

                   3  |   2.593316   .0262895    98.64   0.000      2.54179    2.644843

                   4  |    2.13865   .0286843    74.56   0.000      2.08243     2.19487

                   5  |   2.454583   .0192917   127.24   0.000     2.416772    2.492394

                      |

                _cons |   3.784122   .0367204   103.05   0.000     3.712151    3.856093

---------------------------------------------------------------------------------------

 

. poisgof

 

         Deviance goodness-of-fit =  1067.088

         Prob > chi2(11)          =    0.0000

 

         Pearson goodness-of-fit  =  1294.682

         Prob > chi2(11)          =    0.0000

 

. *That was quasi independenc

 

. poisson count i.meth_num i.feth_num i.endogamy_diagonal_cat i.black_othHisp

 

Iteration 0:   log likelihood = -1622150.1 

Iteration 1:   log likelihood = -448544.31  (backed up)

Iteration 2:   log likelihood = -406174.34  (backed up)

Iteration 3:   log likelihood = -164842.09  (backed up)

Iteration 4:   log likelihood = -122114.39  (backed up)

Iteration 5:   log likelihood = -38616.448 

Iteration 6:   log likelihood = -5553.1389 

Iteration 7:   log likelihood = -541.68591 

Iteration 8:   log likelihood = -407.86486 

Iteration 9:   log likelihood = -407.61852 

Iteration 10:  log likelihood = -407.61852 

 

Poisson regression                                Number of obs   =         25

                                                  LR chi2(14)     = 3152148.07

                                                  Prob > chi2     =     0.0000

Log likelihood = -407.61852                       Pseudo R2       =     0.9997

 

---------------------------------------------------------------------------------------

                count |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]

----------------------+----------------------------------------------------------------

             meth_num |

    Mexican American  |   1.011966    .022452    45.07   0.000     .9679614    1.055972

      Hispanic Other  |   .7375092   .0229166    32.18   0.000     .6925934     .782425

  Non Hispanic Other  |   .5583559   .0241463    23.12   0.000       .51103    .6056819

  White non Hispanic  |   3.178408   .0259865   122.31   0.000     3.127476    3.229341

                      |

             feth_num |

    Mexican American  |   1.952846   .0332485    58.73   0.000      1.88768    2.018012

      Hispanic Other  |   1.713306   .0330711    51.81   0.000     1.648488    1.778124

  Non Hispanic Other  |   1.920179   .0332427    57.76   0.000     1.855024    1.985333

  White non Hispanic  |   4.213423   .0356215   118.28   0.000     4.143607     4.28324

                      |

endogamy_diagonal_cat |

                   1  |   7.180968   .0406743   176.55   0.000     7.101248    7.260688

                   2  |   3.361407   .0238147   141.15   0.000     3.314731    3.408082

                   3  |   2.755277   .0277498    99.29   0.000     2.700889    2.809666

                   4  |   2.207766   .0293102    75.32   0.000     2.150319    2.265213

                   5  |   2.336756   .0206074   113.39   0.000     2.296366    2.377146

                      |

      1.black_othHisp |   1.072106   .0447908    23.94   0.000     .9843172    1.159894

                _cons |   3.476785   .0403842    86.09   0.000     3.397634    3.555937

---------------------------------------------------------------------------------------

 

* Among black married people who are not married to other black people, the log odds of being married to a person from Other-Hispanic background was significantly higher (increased the log odds by 1.07, increased the count by a factor of exp(1.07), or had a relative risk of exp(1.07)) compared to marriages to whites, non-Hispanics, and Mexican Americans. That is, among the non endogamous black married people, more than expected were married to people from the other Hispanic category.

 

. poisgof

 

         Deviance goodness-of-fit =   585.237

         Prob > chi2(10)          =    0.0000

 

         Pearson goodness-of-fit  =  602.9136

         Prob > chi2(10)          =    0.0000

 

* Adds one df, for black-other Hispanic interaction, and improves the fit by (1067-585=482) on 1 df, which is highly significant.

 

. predict QI_and_BOH

(option n assumed; predicted number of events)

 

. table meth_num feth_num, contents(sum count sum QI_and_BOH) row col cellwidth(10)

 

--------------------------------------------------------------------------------------------

husband's           |                         wife's race/ethnicity                         

race/ethnicity      | Black, non  Mexican Am  Hispanic O  Non Hispan  White non        Total

--------------------+-----------------------------------------------------------------------

Black, non Hispanic |      42521         291         412         393        2064       45681

                    |      42521    228.0651    524.3694    220.7353     2186.83       45681

                    |

   Mexican American |         94       18088         612         433        6067       25294

                    |   89.01025       18088    493.7638    607.2439    6015.982       25294

                    |

     Hispanic Other |        310         633        5901         258        4507       11609

                    |   197.6306    476.8205        5901    461.4959    4572.053       11609

                    |

 Non Hispanic Other |        101         317         214        3509        3959        8100

                    |    56.5509    398.6114     313.703        3509    3822.135        8100

                    |

 White non Hispanic |        615        5338        4403        5505      543276      559137

                    |   776.8082    5475.503    4309.164    5299.525      543276      559137

                    |

              Total |      43641       24667       11542       10098      559873      649821

                    |      43641       24667       11542       10098      559873      649821

--------------------------------------------------------------------------------------------

 

. display 310+412

722

 

. display 197.63+524.37

722

 

*We have one term fitting the two cells for black-Other Hispanic intermarriage, so the sum of those two cells is the same in the actual and the predicted.

 

* Now add the gender specific black-other Hispanic term.

 

. gen byte husb_black_wife_OH=0

 

. replace husb_black_wife_OH=1 if meth_num==1 & feth_num==3

(1 real change made)

 

. table meth_num feth_num, contents(mean black_othHisp) cellwidth(10)

 

note: cellwidth too small, variable name truncated;

      to increase cellwidth, specify cellwidth(#)

 

--------------------------------------------------------------------------------

husband's           |                   wife's race/ethnicity                  

race/ethnicity      | Black, non  Mexican Am  Hispanic O  Non Hispan  White non

--------------------+-----------------------------------------------------------

Black, non Hispanic |          0           0           1           0           0

   Mexican American |          0           0           0           0           0

     Hispanic Other |          1           0           0           0           0

 Non Hispanic Other |          0           0           0           0           0

 White non Hispanic |          0           0           0           0           0

--------------------------------------------------------------------------------

 

. table meth_num feth_num, contents(mean husb_black_wife_OH ) cellwidth(10)

 

note: cellwidth too small, variable name truncated;

      to increase cellwidth, specify cellwidth(#)

 

--------------------------------------------------------------------------------

husband's           |                   wife's race/ethnicity                  

race/ethnicity      | Black, non  Mexican Am  Hispanic O  Non Hispan  White non

--------------------+-----------------------------------------------------------

Black, non Hispanic |          0           0           1           0           0

   Mexican American |          0           0           0           0           0

     Hispanic Other |          0           0           0           0           0

 Non Hispanic Other |          0           0           0           0           0

 White non Hispanic |          0           0           0           0           0

--------------------------------------------------------------------------------

 

. poisson count i.meth_num i.feth_num i.endogamy_diagonal_cat i.black_othHisp i.husb_black_wife_OH

 

Iteration 0:   log likelihood = -1622147.3 

Iteration 1:   log likelihood = -448422.28  (backed up)

Iteration 2:   log likelihood = -405890.17  (backed up)

Iteration 3:   log likelihood = -164210.39  (backed up)

Iteration 4:   log likelihood = -121629.82  (backed up)

Iteration 5:   log likelihood = -38857.644 

Iteration 6:   log likelihood = -5529.6282 

Iteration 7:   log likelihood = -491.60417 

Iteration 8:   log likelihood = -355.79505 

Iteration 9:   log likelihood = -355.54662 

Iteration 10:  log likelihood = -355.54662 

 

Poisson regression                                Number of obs   =         25

                                                  LR chi2(15)     = 3152252.22

                                                  Prob > chi2     =     0.0000

Log likelihood = -355.54662                       Pseudo R2       =     0.9998

 

---------------------------------------------------------------------------------------

                count |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]

----------------------+----------------------------------------------------------------

             meth_num |

    Mexican American  |   .9702156   .0224704    43.18   0.000     .9261743    1.014257

      Hispanic Other  |   .6751551   .0234341    28.81   0.000     .6292252     .721085

  Non Hispanic Other  |   .5166051   .0241635    21.38   0.000     .4692455    .5639646

  White non Hispanic  |   3.136658   .0260024   120.63   0.000     3.085694    3.187621

                      |

             feth_num |

    Mexican American  |   2.082757   .0372736    55.88   0.000     2.009703    2.155812

      Hispanic Other  |   1.864941   .0377599    49.39   0.000     1.790933    1.938949

  Non Hispanic Other  |    2.05009   .0372684    55.01   0.000     1.977046    2.123135

  White non Hispanic  |   4.343335   .0394049   110.22   0.000     4.266103    4.420567

                      |

endogamy_diagonal_cat |

                   1  |   7.269129   .0429614   169.20   0.000     7.184926    7.353332

                   2  |   3.361407   .0238147   141.15   0.000     3.314731    3.408082

                   3  |   2.754156   .0277426    99.28   0.000     2.699782    2.808531

                   4  |   2.207766   .0293102    75.32   0.000     2.150319    2.265213

                   5  |   2.336756   .0206074   113.39   0.000     2.296366    2.377146

                      |

      1.black_othHisp |   1.672793   .0697805    23.97   0.000     1.536025     1.80956

 1.husb_black_wife_OH |  -.9053349   .0873382   -10.37   0.000    -1.076515   -.7341552

                _cons |   3.388624   .0426868    79.38   0.000      3.30496    3.472289

---------------------------------------------------------------------------------------

 

. poisgof

 

         Deviance goodness-of-fit =  481.0932

         Prob > chi2(9)           =    0.0000

 

         Pearson goodness-of-fit  =   494.695

         Prob > chi2(9)           =    0.0000

 

. *Now let's see what black-other Hispanic intermarriage looks like of we don't mark out the endogamy

>  diagonal.

 

. poisson count i.meth_num i.feth_num i.black_othHisp

 

Iteration 0:   log likelihood = -312574.59 

Iteration 1:   log likelihood = -232297.17 

Iteration 2:   log likelihood = -224728.61 

Iteration 3:   log likelihood = -224682.36 

Iteration 4:   log likelihood = -224682.36 

 

Poisson regression                                Number of obs   =         25

                                                  LR chi2(9)      = 2703598.60

                                                  Prob > chi2     =     0.0000

Log likelihood = -224682.36                       Pseudo R2       =     0.8575

 

-------------------------------------------------------------------------------------

              count |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]

--------------------+----------------------------------------------------------------

           meth_num |

  Mexican American  |  -.6016685   .0078446   -76.70   0.000    -.6170436   -.5862934

    Hispanic Other  |  -1.341195   .0104305  -128.58   0.000    -1.361639   -1.320752

Non Hispanic Other  |  -1.740372   .0120606  -144.30   0.000     -1.76401   -1.716733

White non Hispanic  |   2.494159   .0048776   511.35   0.000     2.484599    2.503719

                    |

           feth_num |

  Mexican American  |  -.5811256   .0079728   -72.89   0.000    -.5967521   -.5654992

    Hispanic Other  |  -1.299468    .010508  -123.66   0.000    -1.320063   -1.278872

Non Hispanic Other  |  -1.474255   .0110479  -133.44   0.000    -1.495908   -1.452601

White non Hispanic  |   2.541118   .0049812   510.15   0.000     2.531355    2.550881

                    |

    1.black_othHisp |  -.8394343   .0379587   -22.11   0.000    -.9138319   -.7650366

              _cons |   8.048426   .0066011  1219.26   0.000     8.035488    8.061364

-------------------------------------------------------------------------------------

 

*Although the black-Other Hispanic association was positive and significant compared to other forms of non endogamy for black spouses, that is compared to marriage to other non-black groups, when we get rid of the terms for the endogamy diagonal, the black-other Hispanic association is strongly negative, because now we are also comparing to black-black marriage, and that is always more common. Also, without the endogamy diagonal, the model will fit poorly.

 

. poisgof

 

         Deviance goodness-of-fit =  449134.7

         Prob > chi2(15)          =    0.0000

 

         Pearson goodness-of-fit  =   1153768

         Prob > chi2(15)          =    0.0000

 

. *when not controlling for the endogamy diagonal, models tend to fit poorly

 

 

. gen QS=0

 

. replace QS= (meth_num*10+ feth_num) if feth_num>meth_num

(10 real changes made)

 

. replace QS= (feth_num*10+ meth_num) if meth_num>feth_num

(10 real changes made)

 

*Constructing a set of numbers that are symmetric and otherwise different in every cell.

 

. table meth_num feth_num, contents(mean QS) cellwidth(10)

 

--------------------------------------------------------------------------------

husband's           |                   wife's race/ethnicity                  

race/ethnicity      | Black, non  Mexican Am  Hispanic O  Non Hispan  White non

--------------------+-----------------------------------------------------------

Black, non Hispanic |          0          12          13          14          15

   Mexican American |         12           0          23          24          25

     Hispanic Other |         13          23           0          34          35

 Non Hispanic Other |         14          24          34           0          45

 White non Hispanic |         15          25          35          45           0

--------------------------------------------------------------------------------

 

* Quasi symmetry treats the terms as

 

. poisson count i.meth_num i.feth_num i.QS

 

Iteration 0:   log likelihood =   -1621737 

Iteration 1:   log likelihood = -438727.68  (backed up)

Iteration 2:   log likelihood =  -371941.3  (backed up)

Iteration 3:   log likelihood = -207096.11  (backed up)

Iteration 4:   log likelihood = -185110.43 

Iteration 5:   log likelihood = -90707.459 

Iteration 6:   log likelihood =  -16934.19 

Iteration 7:   log likelihood = -573.01331 

Iteration 8:   log likelihood = -173.51256 

Iteration 9:   log likelihood =  -170.2886 

Iteration 10:  log likelihood = -170.28779 

Iteration 11:  log likelihood = -170.28779 

 

Poisson regression                                Number of obs   =         25

                                                  LR chi2(18)     = 3152622.73

                                                  Prob > chi2     =     0.0000

Log likelihood = -170.28779                       Pseudo R2       =     0.9999

 

-------------------------------------------------------------------------------------

              count |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]

--------------------+----------------------------------------------------------------

           meth_num |

  Mexican American  |  -.8865297   .0195915   -45.25   0.000    -.9249284   -.8481311

    Hispanic Other  |  -1.464572   .0203211   -72.07   0.000    -1.504401   -1.424743

Non Hispanic Other  |  -1.916449   .0213965   -89.57   0.000    -1.958386   -1.874513

White non Hispanic  |   .7607015   .0177297    42.91   0.000     .7259519    .7954511

                    |

           feth_num |

  Mexican American  |   .0317804   .0195915     1.62   0.105    -.0066182    .0701791

    Hispanic Other  |  -.5103041   .0203211   -25.11   0.000    -.5501328   -.4704754

Non Hispanic Other  |  -.5782177   .0213965   -27.02   0.000    -.6201542   -.5362813

White non Hispanic  |   1.786918   .0177297   100.79   0.000     1.752168    1.821668

                    |

                 QS |

                12  |  -5.072186   .0518097   -97.90   0.000    -5.173731   -4.970641

                13  |  -3.891192   .0387965  -100.30   0.000    -3.967232   -3.815152

                14  |  -4.109943    .047238   -87.01   0.000    -4.202528   -4.017358

                15  |  -4.857751    .021174  -229.42   0.000    -4.899251    -4.81625

                23  |  -2.809359   .0293163   -95.83   0.000    -2.866818     -2.7519

                24  |  -3.078001    .037751   -81.53   0.000    -3.151991    -3.00401

                25  |  -2.856983   .0101084  -282.64   0.000    -2.876795   -2.837171

                34  |  -2.977466   .0473135   -62.93   0.000    -3.070199   -2.884733

                35  |   -2.54299    .012457  -204.14   0.000    -2.567405   -2.518574

                45  |  -2.234246   .0134023  -166.71   0.000    -2.260515   -2.207978

                    |

              _cons |   10.65775   .0048495  2197.69   0.000     10.64825    10.66726

-------------------------------------------------------------------------------------

 

. poisgof

 

         Deviance goodness-of-fit =  110.5756

         Prob > chi2(6)           =    0.0000

 

         Pearson goodness-of-fit  =  117.1273

         Prob > chi2(6)           =    0.0000

 

. poisson count i.meth_num i.feth_num i.endogamy_diagonal_cat i.QS

 

* Even though it is not obvious why this must be so, the QS terms are the full set of symmetric interaction terms that can be included, so adding the endogamy diagonal terms (which are also symmetric with respect to husband and wife) yield the same model, but with a different set of terms displayed:

 

 

note: 15.QS omitted because of collinearity

note: 25.QS omitted because of collinearity

note: 34.QS omitted because of collinearity

note: 35.QS omitted because of collinearity

note: 45.QS omitted because of collinearity

 

Iteration 0:   log likelihood =   -1621737 

Iteration 1:   log likelihood = -438727.66  (backed up)

Iteration 2:   log likelihood = -371941.28  (backed up)

Iteration 3:   log likelihood = -207096.16  (backed up)

Iteration 4:   log likelihood = -185110.46 

Iteration 5:   log likelihood = -90707.453 

Iteration 6:   log likelihood = -16934.185 

Iteration 7:   log likelihood = -573.01339 

Iteration 8:   log likelihood = -173.51256 

Iteration 9:   log likelihood =  -170.2886 

Iteration 10:  log likelihood = -170.28779 

Iteration 11:  log likelihood = -170.28779 

 

Poisson regression                                Number of obs   =         25

                                                  LR chi2(18)     = 3152622.73

                                                  Prob > chi2     =     0.0000

Log likelihood = -170.28779                       Pseudo R2       =     0.9999

 

---------------------------------------------------------------------------------------

                count |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]

----------------------+----------------------------------------------------------------

             meth_num |

    Mexican American  |   1.114238   .0245816    45.33   0.000     1.066059    1.162417

      Hispanic Other  |    .850189    .025271    33.64   0.000     .8006588    .8997193

  Non Hispanic Other  |    .707055   .0260209    27.17   0.000     .6560549    .7580551

  White non Hispanic  |   3.818683   .0528711    72.23   0.000     3.715057    3.922308

                      |

             feth_num |

    Mexican American  |   2.032548   .0343926    59.10   0.000      1.96514    2.099956

      Hispanic Other  |   1.804457   .0346164    52.13   0.000      1.73661    1.872304

  Non Hispanic Other  |   2.045286   .0344563    59.36   0.000     1.977753     2.11282

  White non Hispanic  |   4.844899    .058194    83.25   0.000     4.730841    4.958957

                      |

endogamy_diagonal_cat |

                   1  |   7.915732   .0643011   123.10   0.000     7.789704     8.04176

                   2  |   3.914197   .0524013    74.70   0.000     3.811492    4.016901

                   3  |   3.286209   .0501069    65.58   0.000     3.188002    3.384417

                   4  |   2.668723   .0513256    52.00   0.000     2.568127     2.76932

                   5  |    1.79977   .0483798    37.20   0.000     1.704947    1.894592

                      |

                   QS |

                  12  |   .8427781   .0735992    11.45   0.000     .6985263      .98703

                  13  |   1.709778   .0634045    26.97   0.000     1.585508    1.834049

                  14  |   1.182285   .0681776    17.34   0.000     1.048659     1.31591

                  15  |          0  (omitted)

                  23  |   .7908445   .0558517    14.16   0.000     .6813773    .9003117

                  24  |   .2134592   .0604599     3.53   0.000     .0949599    .3319584

                  25  |          0  (omitted)

                  34  |          0  (omitted)

                  35  |          0  (omitted)

                  45  |          0  (omitted)

                      |

                _cons |   2.742022    .064118    42.77   0.000     2.616353    2.867691

---------------------------------------------------------------------------------------

 

. poisgof

 

         Deviance goodness-of-fit =  110.5756

         Prob > chi2(6)           =    0.0000

 

         Pearson goodness-of-fit  =  117.1273

         Prob > chi2(6)           =    0.0000

 

. *This is another version of the QS, quasi symmetry model, which has the endogamy diagonal displa

> cing 5 of the off-diagonal QS terms.

 

. *gen ID_QS=(50/649821)*(abs(count- constant_only_class ))

 

. predict QS_predicted

(option n assumed; predicted number of events)

 

. *gen ID_QS=(50/649821)*(abs(count- QS_predicted ))

 

. gen ID_QS=(50/649821)*(abs(count- QS_predicted ))

 

. table meth_num feth_num, contents(sum ID_QS) row col cellwidth(10)

 

--------------------------------------------------------------------------------------------

husband's           |                         wife's race/ethnicity                         

race/ethnicity      | Black, non  Mexican Am  Hispanic O  Non Hispan  White non        Total

--------------------+-----------------------------------------------------------------------

Black, non Hispanic |          0    .0012189    .0084073    .0001272    .0070611    .0168145

   Mexican American |   .0012189           0     .001669     .001508    .0043959    .0087917

     Hispanic Other |   .0084073     .001669           0    .0017512     .008325    .0201525

 Non Hispanic Other |   .0001272     .001508    .0017512           0    .0031319    .0065183

 White non Hispanic |   .0070611    .0043959     .008325    .0031319           0    .0229139

                    |

              Total |   .0168145    .0087917    .0201525    .0065183    .0229139     .075191

--------------------------------------------------------------------------------------------

 

. poisson count i.meth_num i.feth_num i.endogamy_diagonal_cat i.black_othHisp i.husb_black_wife_OH

 

Iteration 0:   log likelihood = -1622147.3 

Iteration 1:   log likelihood = -448422.28  (backed up)

Iteration 2:   log likelihood = -405890.17  (backed up)

Iteration 3:   log likelihood = -164210.39  (backed up)

Iteration 4:   log likelihood = -121629.82  (backed up)

Iteration 5:   log likelihood = -38857.644 

Iteration 6:   log likelihood = -5529.6282 

Iteration 7:   log likelihood = -491.60417 

Iteration 8:   log likelihood = -355.79505 

Iteration 9:   log likelihood = -355.54662 

Iteration 10:  log likelihood = -355.54662  

 

Poisson regression                                Number of obs   =         25

                                                  LR chi2(15)     = 3152252.22

                                                  Prob > chi2     =     0.0000

Log likelihood = -355.54662                       Pseudo R2       =     0.9998

 

---------------------------------------------------------------------------------------

                count |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]

----------------------+----------------------------------------------------------------

             meth_num |

    Mexican American  |   .9702156   .0224704    43.18   0.000     .9261743    1.014257

      Hispanic Other  |   .6751551   .0234341    28.81   0.000     .6292252     .721085

  Non Hispanic Other  |   .5166051   .0241635    21.38   0.000     .4692455    .5639646

  White non Hispanic  |   3.136658   .0260024   120.63   0.000     3.085694    3.187621

                      |

             feth_num |

    Mexican American  |   2.082757   .0372736    55.88   0.000     2.009703    2.155812

      Hispanic Other  |   1.864941   .0377599    49.39   0.000     1.790933    1.938949

  Non Hispanic Other  |    2.05009   .0372684    55.01   0.000     1.977046    2.123135

  White non Hispanic  |   4.343335   .0394049   110.22   0.000     4.266103    4.420567

                      |

endogamy_diagonal_cat |

                   1  |   7.269129   .0429614   169.20   0.000     7.184926    7.353332

                   2  |   3.361407   .0238147   141.15   0.000     3.314731    3.408082

                   3  |   2.754156   .0277426    99.28   0.000     2.699782    2.808531

                   4  |   2.207766   .0293102    75.32   0.000     2.150319    2.265213

                   5  |   2.336756   .0206074   113.39   0.000     2.296366    2.377146

                      |

      1.black_othHisp |   1.672793   .0697805    23.97   0.000     1.536025     1.80956

 1.husb_black_wife_OH |  -.9053349   .0873382   -10.37   0.000    -1.076515   -.7341552

                _cons |   3.388624   .0426868    79.38   0.000      3.30496    3.472289

---------------------------------------------------------------------------------------

 

. * lincom can test whether two terms, for instance two endogamy terms, are significantly different from each other. To test whether the force of endogamy is the same across groups or different, that would be a goodness of fit test between the two models, one which had a single term for endogamy, and the Quasi-Independence model with 5 endogamy terms.

.

. lincom 4.endogamy_diagonal_cat-5.endogamy_diagonal_cat

 

 ( 1)  [count]4.endogamy_diagonal_cat - [count]5.endogamy_diagonal_cat = 0

 

------------------------------------------------------------------------------

       count |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]

-------------+----------------------------------------------------------------

         (1) |  -.1289895   .0431923    -2.99   0.003    -.2136449   -.0443342

------------------------------------------------------------------------------

 

*How do we know that the goodness of fit test at the top of the model is compared to the constant only model? We run the constant only model and compute the -2 times log likelihood of the difference of the two models.

 

. display (-1576481-(-355.54))*-2

3152250.9

 

. log close

      name:  <unnamed>

       log:  C:\Users\mexmi\Documents\newer web pages\Soc_382\logs\2nd loglin intermar class.log

  log type:  text

 closed on:  31 Jan 2019, 14:04:47

--------------------------------------------------------------------------------------------------