------------------------------------------------------------------------------------------------------------- log: C:\AAA Miker Files\newer web pages\soc_388_notes\class 7, 2002.log log type: text opened on: 16 Oct 2002, 13:15:59 . use "C:\AAA Miker Files\newer web pages\soc_388_notes\Qian 80-90 intermar.dta", clear . *This is the 80-90 intermarriage dataset, not for homework but for general illustrations and class . *There are 5 variables plus count . describe Contains data from C:\AAA Miker Files\newer web pages\soc_388_notes\Qian 80-90 intermar.dta obs: 512 vars: 6 16 Oct 2001 11:12 size: 10,752 (99.9% of memory free) ------------------------------------------------------------------------------- storage display value variable name type format label variable label ------------------------------------------------------------------------------- mfulleth str5 %9s med4 byte %8.0g ffulleth str5 %9s fed4 byte %8.0g count long %12.0g COUNT year byte %8.0g ------------------------------------------------------------------------------- Sorted by: year med4 fed4 . table mfulleth ffulleth, contents (sum count) -------------------------------------- | ffulleth mfulleth | Asian Hisp black white ----------+--------------------------- Asian | 372 43 7 320 Hisp | 40 15469 227 7189 black | 11 459 34334 1625 white | 447 6744 458 455797 -------------------------------------- . table mfulleth ffulleth, contents (sum count) row col -------------------------------------------------- | ffulleth mfulleth | Asian Hisp black white Total ----------+--------------------------------------- Asian | 372 43 7 320 742 Hisp | 40 15469 227 7189 22925 black | 11 459 34334 1625 36429 white | 447 6744 458 455797 463446 | Total | 870 22715 35026 464931 523542 -------------------------------------------------- . table mfulleth ffulleth, contents (sum count) by ( med4 fed4 year) -------------------------------------- med4, | fed4, | year and | ffulleth mfulleth | Asian Hisp black white ----------+--------------------------- 1 | 1 | 80 | Asian | 1 0 0 2 Hisp | 1 2180 13 341 black | 1 24 2039 50 white | 6 165 12 15801 ----------+--------------------------- 1 | 1 | 90 | Asian | 0 0 0 4 Hisp | 1 870 7 187 black | 0 11 713 36 white | 4 156 11 9380 ----------+--------------------------- 1 | 2 | 80 | Asian | 1 2 1 6 Hisp | 0 1119 10 351 black | 0 15 2173 59 white | 8 235 17 17604 ----------+--------------------------- 1 | 2 | 90 | Asian | 0 0 0 2 Hisp | 0 565 8 217 black | 0 12 633 36 white | 2 149 7 10142 ----------+--------------------------- 1 | 3 | 80 | Asian | 0 0 0 0 Hisp | 0 204 6 65 black | 0 3 598 21 white | 1 43 3 2509 ----------+--------------------------- 1 | 3 | 90 | Asian | 0 0 0 1 Hisp | 1 222 3 100 black | 0 4 394 21 white | 5 71 10 4122 ----------+--------------------------- 1 | 4 | 80 | Asian | 1 0 0 0 Hisp | 0 29 0 6 black | 0 2 78 0 white | 2 5 1 367 ----------+--------------------------- 1 | 4 | 90 | Asian | 0 0 0 0 Hisp | 0 13 0 11 black | 0 0 43 1 white | 0 5 1 423 ----------+--------------------------- 2 | 1 | 80 | Asian | 2 0 0 5 Hisp | 1 1129 4 311 black | 0 23 1716 73 white | 4 283 19 15539 ----------+--------------------------- 2 | 1 | 90 | Asian | 2 2 0 3 Hisp | 0 468 6 146 black | 0 13 557 42 white | 3 140 11 7868 ----------+--------------------------- 2 | 2 | 80 | Asian | 30 4 1 26 Hisp | 7 2383 31 1132 black | 3 62 6734 227 white | 46 1082 59 81301 ----------+--------------------------- 2 | 2 | 90 | Asian | 1 2 0 11 Hisp | 3 1227 17 547 black | 0 48 2643 148 white | 18 572 44 39467 ----------+--------------------------- 2 | 3 | 80 | Asian | 16 2 0 9 Hisp | 3 477 13 257 black | 1 21 2054 71 white | 17 257 21 18173 ----------+--------------------------- 2 | 3 | 90 | Asian | 4 3 1 5 Hisp | 0 497 19 334 black | 0 21 1513 77 white | 16 343 32 19526 ----------+--------------------------- 2 | 4 | 80 | Asian | 3 1 0 0 Hisp | 0 45 3 37 black | 1 3 405 14 white | 3 37 5 4161 ----------+--------------------------- 2 | 4 | 90 | Asian | 0 0 0 0 Hisp | 1 42 1 34 black | 0 1 216 5 white | 4 41 2 3381 ----------+--------------------------- 3 | 1 | 80 | Asian | 1 1 0 5 Hisp | 1 264 3 87 black | 0 10 374 22 white | 1 71 1 2982 ----------+--------------------------- 3 | 1 | 90 | Asian | 0 0 0 2 Hisp | 0 163 1 76 black | 0 3 210 22 white | 4 85 5 2657 ----------+--------------------------- 3 | 2 | 80 | Asian | 18 2 1 19 Hisp | 3 782 12 473 black | 0 32 1911 108 white | 25 390 17 27314 ----------+--------------------------- 3 | 2 | 90 | Asian | 2 3 1 10 Hisp | 2 419 7 313 black | 0 18 870 89 white | 6 295 23 15601 ----------+--------------------------- 3 | 3 | 80 | Asian | 48 4 0 32 Hisp | 2 607 12 404 black | 2 31 2162 93 white | 36 390 25 24167 ----------+--------------------------- 3 | 3 | 90 | Asian | 14 6 1 26 Hisp | 3 783 23 624 black | 1 39 2119 160 white | 21 636 53 29109 ----------+--------------------------- 3 | 4 | 80 | Asian | 23 1 0 8 Hisp | 1 128 3 97 black | 1 7 660 27 white | 21 88 3 8301 ----------+--------------------------- 3 | 4 | 90 | Asian | 10 2 0 6 Hisp | 0 102 4 145 black | 0 5 501 43 white | 15 115 10 7868 ----------+--------------------------- 4 | 1 | 80 | Asian | 0 0 0 1 Hisp | 0 24 3 12 black | 0 0 53 1 white | 1 11 1 519 ----------+--------------------------- 4 | 1 | 90 | Asian | 0 0 0 0 Hisp | 0 10 0 3 black | 0 1 27 1 white | 0 13 0 303 ----------+--------------------------- 4 | 2 | 80 | Asian | 5 2 0 12 Hisp | 1 141 0 112 black | 0 10 354 27 white | 3 132 5 9821 ----------+--------------------------- 4 | 2 | 90 | Asian | 1 3 0 5 Hisp | 0 35 2 34 black | 0 3 94 6 white | 2 42 3 2939 ----------+--------------------------- 4 | 3 | 80 | Asian | 39 0 1 24 Hisp | 2 157 5 161 black | 0 15 667 37 white | 24 198 12 16340 ----------+--------------------------- 4 | 3 | 90 | Asian | 10 0 0 9 Hisp | 1 130 1 118 black | 0 6 324 32 white | 12 205 10 10095 ----------+--------------------------- 4 | 4 | 80 | Asian | 89 0 0 50 Hisp | 5 164 4 234 black | 0 8 1045 38 white | 75 192 14 27573 ----------+--------------------------- 4 | 4 | 90 | Asian | 51 3 0 37 Hisp | 1 90 6 220 black | 1 8 454 38 white | 62 297 21 20444 -------------------------------------- . describe Contains data from C:\AAA Miker Files\newer web pages\soc_388_notes\Qian 80-90 intermar.dta obs: 512 vars: 6 16 Oct 2001 11:12 size: 10,752 (99.7% of memory free) ------------------------------------------------------------------------------- storage display value variable name type format label variable label ------------------------------------------------------------------------------- mfulleth str5 %9s med4 byte %8.0g ffulleth str5 %9s fed4 byte %8.0g count long %12.0g COUNT year byte %8.0g ------------------------------------------------------------------------------- Sorted by: year med4 fed4 . display 4*4*4*4*2 512 . desmat: poisson count mfulleth*med4*year ffulleth*fed4*year ------------------------------------------------------------------------------- poisson ------------------------------------------------------------------------------- Dependent variable count Number of observations: 512 Initial log likelihood: -1402408.286 Log likelihood: -272981.859 LR chi square: 2258852.856 Model degrees of freedom: 61 Pseudo R-squared: 0.805 Prob: 0.000 ------------------------------------------------------------------------------- nr Effect Coeff s.e. ------------------------------------------------------------------------------- count mfulleth 1 Hisp 5.732** 0.268 2 black 5.890** 0.268 3 white 7.873** 0.267 med4 4 2 1.955** 0.285 5 3 2.454** 0.278 6 4 2.767** 0.275 mfulleth.med4 7 Hisp.2 -1.656** 0.286 8 Hisp.3 -2.861** 0.279 9 Hisp.4 -4.207** 0.278 10 black.2 -1.143** 0.286 11 black.3 -2.382** 0.279 12 black.4 -3.576** 0.277 13 white.2 -0.765** 0.286 14 white.3 -1.903** 0.278 15 white.4 -2.367** 0.276 year 16 90 -0.636 0.579 mfulleth.year 17 Hisp.90 0.020 0.464 18 black.90 -0.284 0.464 19 white.90 0.287 0.463 med4.year 20 2.90 -0.375 0.504 21 3.90 0.019 0.482 22 4.90 0.066 0.477 mfulleth.med4.year 23 Hisp.2.90 0.492 0.505 24 Hisp.3.90 0.578 0.484 25 Hisp.4.90 0.154 0.480 26 black.2.90 0.583 0.505 27 black.3.90 0.671 0.483 28 black.4.90 0.094 0.479 29 white.2.90 0.255 0.504 30 white.3.90 0.266 0.482 31 white.4.90 -0.125 0.477 ffulleth 32 Hisp 5.344** 0.224 33 black 5.356** 0.224 34 white 7.489** 0.224 fed4 35 2 2.015** 0.238 36 3 2.257** 0.235 37 4 2.420** 0.233 ffulleth.fed4 38 Hisp.2 -1.591** 0.239 39 Hisp.3 -2.809** 0.236 40 Hisp.4 -4.194** 0.237 41 black.2 -1.032** 0.239 42 black.3 -1.982** 0.236 43 black.4 -3.067** 0.235 44 white.2 -0.660** 0.238 45 white.3 -1.700** 0.235 46 white.4 -2.285** 0.233 ffulleth.year 47 Hisp.90 -0.415 0.350 48 black.90 -0.650 0.350 49 white.90 -0.188 0.349 fed4.year 50 2.90 -1.043** 0.394 51 3.90 -0.418 0.372 52 4.90 -0.083 0.364 ffulleth.fed4.year 53 Hisp.2.90 1.181** 0.395 54 Hisp.3.90 1.398** 0.374 55 Hisp.4.90 0.874* 0.369 56 black.2.90 1.094** 0.395 57 black.3.90 1.211** 0.373 58 black.4.90 0.522 0.367 59 white.2.90 0.899* 0.394 60 white.3.90 0.995** 0.372 61 white.4.90 0.402 0.365 62 _cons -7.026** 0.348 ------------------------------------------------------------------------------- * p < .05 ** p < .01 . *we may come back to this intermarriage dataset, but for now, on to something else. . clear all . use "C:\AAA Miker Files\current class files\methods tabular arrays\ed intermar.dta", clear . clear all . use "C:\AAA Miker Files\current class files\methods tabular arrays\LA intermar.dta", clear . clear all . use "C:\AAA Miker Files\current class files\methods tabular arrays\HW2.dta", clear . table husb wife, contents (sum count) ----------------------------------------------------------------------- | wife husb | black mexican oth hisp all others white -----------+----------------------------------------------------------- black | 4074 63 32 42 215 mexican | 25 3947 143 95 1009 oth hisp | 16 132 239 18 304 all others | 19 78 18 1022 360 white | 103 1156 373 492 28453 ----------------------------------------------------------------------- . table husb wife, contents (sum race_endog) ----------------------------------------------------------------------- | wife husb | black mexican oth hisp all others white -----------+----------------------------------------------------------- black | 1 0 0 0 0 mexican | 0 2 0 0 0 oth hisp | 0 0 3 0 0 all others | 0 0 0 4 0 white | 0 0 0 0 5 ----------------------------------------------------------------------- . desmat: poisson count husb wife race_endog ------------------------------------------------------------------------------- poisson ------------------------------------------------------------------------------- Dependent variable count Number of observations: 25 Initial log likelihood: -80138.505 Log likelihood: -132.836 LR chi square: 160011.338 Model degrees of freedom: 13 Pseudo R-squared: 0.998 Prob: 0.000 ------------------------------------------------------------------------------- nr Effect Coeff s.e. ------------------------------------------------------------------------------- count husb 1 mexican 1.485** 0.061 2 oth hisp 0.340** 0.071 3 all others 0.361** 0.070 4 white 2.791** 0.065 wife 5 mexican 2.328** 0.083 6 oth hisp 1.262** 0.089 7 all others 1.397** 0.088 8 white 3.498** 0.087 race_endog 9 1 6.378** 0.099 10 2 2.533** 0.055 11 3 1.940** 0.094 12 4 3.237** 0.073 13 5 2.032** 0.051 14 _cons 1.934** 0.098 ------------------------------------------------------------------------------- * p < .05 ** p < .01 . poisgof Goodness-of-fit chi2 = 87.85888 Prob > chi2(11) = 0.0000 . *The _x terms correspond to the model that fits the marginals plus the endogamy diagonal. Now we're goi > ng to add a couple of off diagonal terms in a stepwise fashion. . table husb wife, contents (sum bw) ----------------------------------------------------------------------- | wife husb | black mexican oth hisp all others white -----------+----------------------------------------------------------- black | 0 0 0 0 1 mexican | 0 0 0 0 0 oth hisp | 0 0 0 0 0 all others | 0 0 0 0 0 white | 1 0 0 0 0 ----------------------------------------------------------------------- . table husb wife, contents (sum bm) ----------------------------------------------------------------------- | wife husb | black mexican oth hisp all others white -----------+----------------------------------------------------------- black | 0 1 0 0 0 mexican | 1 0 0 0 0 oth hisp | 0 0 0 0 0 all others | 0 0 0 0 0 white | 0 0 0 0 0 ----------------------------------------------------------------------- . table husb wife, contents (sum Moh) ----------------------------------------------------------------------- | wife husb | black mexican oth hisp all others white -----------+----------------------------------------------------------- black | 0 0 0 0 0 mexican | 0 0 1 0 0 oth hisp | 0 1 0 0 0 all others | 0 0 0 0 0 white | 0 0 0 0 0 ----------------------------------------------------------------------- . table husb wife, contents (sum aw) ----------------------------------------------------------------------- | wife husb | black mexican oth hisp all others white -----------+----------------------------------------------------------- black | 0 0 0 0 0 mexican | 0 0 0 0 0 oth hisp | 0 0 0 0 0 all others | 0 0 0 0 1 white | 0 0 0 1 0 ----------------------------------------------------------------------- . sw poisson count (_x*) bw bm Moh aw, forward pe (.05) pr(0.1) begin with empty model p = 0.0000 < 0.0500 adding _x_1 _x_2 _x_3 _x_4 _x_5 _x_6 _x_7 _x_8 _x_9 _x_10 _x_11 _x_12 _x_13 p = 0.0000 < 0.0500 adding Moh p = 0.0000 < 0.0500 adding bw p = 0.0002 < 0.0500 adding bm Poisson regression Number of obs = 25 LR chi2(16) = 160092.89 Prob > chi2 = 0.0000 Log likelihood = -92.058605 Pseudo R2 = 0.9989 ------------------------------------------------------------------------------ count | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- _x_1 | .6580387 .1237163 5.32 0.000 .4155592 .9005183 _x_2 | -.5675102 .1336998 -4.24 0.000 -.829557 -.3054634 _x_3 | -.3744226 .1266318 -2.96 0.003 -.6226164 -.1262289 _x_4 | 2.387004 .1030538 23.16 0.000 2.185023 2.588986 _x_5 | 1.48623 .1386654 10.72 0.000 1.214451 1.758009 _x_6 | .3329503 .1481206 2.25 0.025 .0426393 .6232614 _x_7 | .6221063 .1419782 4.38 0.000 .3438341 .9003785 _x_8 | 3.080996 .1205447 25.56 0.000 2.844733 3.317259 _x_9 | 5.127894 .210949 24.31 0.000 4.714442 5.541347 _x_10 | 2.951956 .0833704 35.41 0.000 2.788553 3.115359 _x_11 | 2.526537 .1204165 20.98 0.000 2.290525 2.762549 _x_12 | 3.497347 .0853671 40.97 0.000 3.330031 3.664663 _x_13 | 1.603523 .0796469 20.13 0.000 1.447418 1.759628 Moh | .7836307 .1017227 7.70 0.000 .5842579 .9830034 bw | -.9086142 .1332381 -6.82 0.000 -1.169756 -.6474723 bm | -.5558246 .1472988 -3.77 0.000 -.844525 -.2671243 _cons | 3.184486 .2103664 15.14 0.000 2.772176 3.596797 ------------------------------------------------------------------------------ . poisgof Goodness-of-fit chi2 = 6.304709 Prob > chi2(8) = 0.6131 . desrep ------------------------------------------------------------------------------- poisson ------------------------------------------------------------------------------- Dependent variable count Number of observations: 25 Initial log likelihood: -80138.505 Log likelihood: -92.059 LR chi square: 160092.893 Model degrees of freedom: 16 Pseudo R-squared: 0.999 Prob: 0.000 ------------------------------------------------------------------------------- nr Effect Coeff s.e. ------------------------------------------------------------------------------- count husb 1 mexican 0.658** 0.124 2 oth hisp -0.568** 0.134 3 all others -0.374** 0.127 4 white 2.387** 0.103 wife 5 mexican 1.486** 0.139 6 oth hisp 0.333* 0.148 7 all others 0.622** 0.142 8 white 3.081** 0.121 race_endog 9 1 5.128** 0.211 10 2 2.952** 0.083 11 3 2.527** 0.120 12 4 3.497** 0.085 13 5 1.604** 0.080 14 Moh 0.784** 0.102 15 bw -0.909** 0.133 16 bm -0.556** 0.147 17 _cons 3.184** 0.210 ------------------------------------------------------------------------------- * p < .05 ** p < .01 . poisgof Goodness-of-fit chi2 = 6.304709 Prob > chi2(8) = 0.6131 . *desrep gives you the report on what the _x terms actually mean . *let me run a quick comparison between Black endogamy and the endogamy of the next strongest group, from > this model. . test _x_9- _x_12=0 ( 1) [count]_x_9 - [count]_x_12 = 0.0 chi2( 1) = 43.10 Prob > chi2 = 0.0000 . poisgof, pearson Goodness-of-fit chi2 = 6.032969 Prob > chi2(8) = 0.6435 . *the pearson goodness of fit is a similar statistic to the LRT goodness of it. . save "C:\AAA Miker Files\current class files\methods tabular arrays\HW2.dta", replace file C:\AAA Miker Files\current class files\methods tabular arrays\HW2.dta saved . exit, clear