. tab admit sex [freq=nobs], chi2 col | sex admit | 1 2 | Total -----------+----------------------+---------- 1 | 1198 557 | 1755 | 44.49 30.35 | 38.76 -----------+----------------------+---------- 2 | 1495 1278 | 2773 | 55.51 69.65 | 61.24 -----------+----------------------+---------- Total | 2693 1835 | 4528 | 100.00 100.00 | 100.00 Pearson chi2(1) = 91.8179 Pr = 0.000 . table dept admit sex [freq=nobs], row ----------+------------------------- | sex and admit | ---- 1 --- ---- 2 --- dept | 1 2 1 2 ----------+------------------------- 1 | 512 313 89 19 2 | 353 207 17 8 3 | 120 207 202 391 4 | 138 279 131 244 5 | 53 138 94 299 6 | 22 351 24 317 | Total | 1198 1495 557 1278 ----------+------------------------- . xi: logit i.admit i.dept i.sex [freq=nobs] i.admit Iadmit_1-2 (naturally coded; Iadmit_1 omitted) i.dept Idept_1-6 (naturally coded; Idept_1 omitted) i.sex Isex_1-2 (naturally coded; Isex_1 omitted) Iteration 0: Log Likelihood =-3023.1513 Iteration 1: Log Likelihood =-2615.3684 Iteration 2: Log Likelihood =-2595.7949 Iteration 3: Log Likelihood =-2594.5718 Iteration 4: Log Likelihood =-2594.5619 Logit Estimates Number of obs = 4528 chi2(6) = 857.18 Prob > chi2 = 0.0000 Log Likelihood = -2594.5619 Pseudo R2 = 0.1418 ------------------------------------------------------------------------------ Iadmit_2 | Coef. Std. Err. z P>|z| [95% Conf. Interval] ---------+-------------------------------------------------------------------- Idept_2 | .0431947 .109839 0.393 0.694 -.1720859 .2584752 Idept_3 | 1.267352 .1065668 11.893 0.000 1.058485 1.476219 Idept_4 | 1.295662 .1058292 12.243 0.000 1.08824 1.503083 Idept_5 | 1.74094 .1261213 13.804 0.000 1.493747 1.988134 Idept_6 | 3.307587 .1699797 19.459 0.000 2.974433 3.640741 Isex_2 | -.1027308 .080821 -1.271 0.204 -.2611371 .0556755 _cons | -.5817292 .0689917 -8.432 0.000 -.7169504 -.446508 ------------------------------------------------------------------------------ . loglin nobs dept admit sex, fit(admit dept, admit sex, dept sex) resid Variable dept = A Variable admit = B Variable sex = C Margins fit: admit dept, admit sex, dept sex Note: Regression-like constraints are assumed. The first level of each variable (and all iteractions with it) will be dropped from estimation. Iteration 0: Log Likelihood = -90.029297 Iteration 1: Log Likelihood = -89.537109 Poisson regression Number of obs = 24 Goodness-of-fit chi2(5) = 20.004 Model chi2(18) =2630.445 Prob > chi2 = 0.0012 Prob > chi2 = 0.0000 Log Likelihood = -89.537 Pseudo R2 = 0.9363 ------------------------------------------------------------------------------ nobs | Coef. Std. Err. z P>|z| [95% Conf. Interval] ---------+-------------------------------------------------------------------- A2 | -.4031484 .0678381 -5.943 0.000 -.5361086 -.2701882 A3 | -1.575025 .0894123 -17.615 0.000 -1.75027 -1.39978 A4 | -1.350814 .0852799 -15.840 0.000 -1.517959 -1.183668 A5 | -2.451194 .1175863 -20.846 0.000 -2.681659 -2.220729 A6 | -3.139097 .1617604 -19.406 0.000 -3.456142 -2.822052 AC22 | -1.074797 .2286134 -4.701 0.000 -1.522871 -.6267235 AC32 | 2.659982 .1260382 21.105 0.000 2.412952 2.907013 AC42 | 1.959243 .127344 15.385 0.000 1.709654 2.208833 AC52 | 2.796379 .1392643 20.080 0.000 2.523425 3.069332 AC62 | 2.004028 .1357227 14.766 0.000 1.738016 2.270039 B2 | -.581729 .0689917 -8.432 0.000 -.7169502 -.4465078 BA22 | .0431944 .109839 0.393 0.694 -.1720861 .2584749 BA23 | 1.267352 .1065668 11.893 0.000 1.058485 1.476219 BA24 | 1.295661 .1058292 12.243 0.000 1.08824 1.503083 BA25 | 1.74094 .1261214 13.804 0.000 1.493747 1.988134 BA26 | 3.307587 .1699914 19.457 0.000 2.97441 3.640764 BC22 | -.1027308 .0808215 -1.271 0.204 -.261138 .0556764 C2 | -1.997621 .1059227 -18.859 0.000 -2.205226 -1.790016 _cons | 6.271383 .0427082 146.843 0.000 6.187676 6.355089 ------------------------------------------------------------------------------ nobs dept admit sex cellhat resid stdres 512 1 1 1 529.209 -17.209 -0.748 89 1 1 2 71.791 17.209 2.031 313 1 2 1 295.791 17.209 1.001 19 1 2 2 36.209 -17.209 -2.860 353 2 1 1 353.624 -0.624 -0.033 17 2 1 2 16.376 0.624 0.154 207 2 2 1 206.376 0.624 0.043 8 2 2 2 8.624 -0.624 -0.212 120 3 1 1 109.547 10.453 0.999 202 3 1 2 212.453 -10.453 -0.717 207 3 2 1 217.452 -10.452 -0.709 391 3 2 2 380.547 10.453 0.536 138 4 1 1 137.081 0.919 0.079 131 4 1 2 131.919 -0.919 -0.080 279 4 2 1 279.919 -0.919 -0.055 244 4 2 2 243.081 0.919 0.059 53 5 1 1 45.613 7.387 1.094 94 5 1 2 101.387 -7.387 -0.734 138 5 2 1 145.387 -7.387 -0.613 299 5 2 2 291.613 7.387 0.433 22 6 1 1 22.926 -0.926 -0.193 24 6 1 2 23.074 0.926 0.193 351 6 2 1 350.074 0.926 0.050 317 6 2 2 317.926 -0.926 -0.052 . loglin nobs dept admit sex, fit(dept admit sex) keep Variable dept = A Variable admit = B Variable sex = C Margins fit: dept admit sex Note: Regression-like constraints are assumed. The first level of each variable (and all iteractions with it) will be dropped from estimation. Iteration 0: Log Likelihood = -79.587891 Iteration 1: Log Likelihood = -79.535156 Poisson regression Number of obs = 24 Goodness-of-fit chi2(0) = 0.000 Model chi2(23) =2650.449 Prob > chi2 = . Prob > chi2 = 0.0000 Log Likelihood = -79.535 Pseudo R2 = 0.9434 ------------------------------------------------------------------------------ nobs | Coef. Std. Err. z P>|z| [95% Conf. Interval] ---------+-------------------------------------------------------------------- A2 | -.3718567 .0691808 -5.375 0.000 -.5074486 -.2362648 A3 | -1.450833 .1014222 -14.305 0.000 -1.649617 -1.252049 A4 | -1.311071 .095914 -13.669 0.000 -1.499059 -1.123083 A5 | -2.268033 .144295 -15.718 0.000 -2.550846 -1.98522 A6 | -3.147282 .217733 -14.455 0.000 -3.574031 -2.720533 AB22 | -.0416279 .1131892 -0.368 0.713 -.2634746 .1802188 AB32 | 1.037348 .1353228 7.666 0.000 .7721204 1.302576 AB42 | 1.196079 .1264066 9.462 0.000 .9483269 1.443832 AB52 | 1.449083 .1768115 8.196 0.000 1.102539 1.795627 AB62 | 3.261865 .2311959 14.109 0.000 2.808729 3.715001 AC22 | -1.283566 .273579 -4.692 0.000 -1.819771 -.7473615 AC32 | 2.270464 .162705 13.954 0.000 1.951568 2.58936 AC42 | 1.697632 .1675382 10.133 0.000 1.369263 2.026001 AC52 | 2.322691 .2066284 11.241 0.000 1.917707 2.727675 AC62 | 1.836699 .316718 5.799 0.000 1.215944 2.457455 ABC222 | .8320537 .5103946 1.630 0.103 -.1683013 1.832409 ABC322 | 1.167289 .2994793 3.898 0.000 .5803207 1.754258 ABC422 | .970089 .3026187 3.206 0.001 .3769672 1.563211 ABC522 | 1.252263 .330322 3.791 0.000 .6048441 1.899683 ABC622 | .8631802 .4026665 2.144 0.032 .0739683 1.652392 B2 | -.4921212 .0717497 -6.859 0.000 -.632748 -.3514945 BC22 | -1.052076 .2627081 -4.005 0.000 -1.566975 -.537178 C2 | -1.749688 .1148437 -15.235 0.000 -1.974778 -1.524599 _cons | 6.238325 .0441942 141.157 0.000 6.151706 6.324944 ------------------------------------------------------------------------------ . generate ABC122= (dept==1) & (admit==2) & (sex==2) So that we don't have to list each of the dummy variables separately in our poisson regression command, we take advantage of Stata's feature that permits ranges of variables in a variable list. A range of variables is any set of consecutive variables, where "consecutive" means "in the order they appear in the Stata data set". To discover this order, we give the -describe- command. We discover that the terms we need (all but the three-way interaction terms) are variables 12 through 29, that is A2 through BC22. . describe Contains data from berk2.dta obs: 24 vars: 35 27 Feb 1997 09:58 size: 1,296 (96.8% of memory free) ------------------------------------------------------------------------------- 1. dept float %9.0g 2. admit float %9.0g 3. sex float %9.0g 4. nobs float %9.0g 5. Iadmit_2 byte %8.0g admit==2 6. Idept_2 byte %8.0g dept==2 7. Idept_3 byte %8.0g dept==3 8. Idept_4 byte %8.0g dept==4 9. Idept_5 byte %8.0g dept==5 10. Idept_6 byte %8.0g dept==6 11. Isex_2 byte %8.0g sex==2 12. A2 byte %8.0g dept== 2.0000 13. A3 byte %8.0g dept== 3.0000 14. A4 byte %8.0g dept== 4.0000 15. A5 byte %8.0g dept== 5.0000 16. A6 byte %8.0g dept== 6.0000 17. B2 byte %8.0g admit== 2.0000 18. C2 byte %8.0g sex== 2.0000 19. AB22 byte %8.0g 20. AB32 byte %8.0g 21. AB42 byte %8.0g 22. AB52 byte %8.0g 23. AB62 byte %8.0g 24. AC22 byte %8.0g 25. AC32 byte %8.0g 26. AC42 byte %8.0g 27. AC52 byte %8.0g 28. AC62 byte %8.0g 29. BC22 byte %8.0g 30. ABC222 byte %8.0g 31. ABC322 byte %8.0g 32. ABC422 byte %8.0g 33. ABC522 byte %8.0g 34. ABC622 byte %8.0g 35. ABC122 float %9.0g ------------------------------------------------------------------------------- Sorted by: Note: data has changed since last save . poisson nobs A2-BC22 ABC122 Iteration 0: Log Likelihood = -80.837891 Iteration 1: Log Likelihood = -80.771484 Poisson regression Number of obs = 24 Goodness-of-fit chi2(4) = 2.473 Model chi2(19) =2647.977 Prob > chi2 = 0.6495 Prob > chi2 = 0.0000 Log Likelihood = -80.771 Pseudo R2 = 0.9425 ------------------------------------------------------------------------------ nobs | Coef. Std. Err. z P>|z| [95% Conf. Interval] ---------+-------------------------------------------------------------------- A2 | -.3680674 .0687936 -5.350 0.000 -.5029003 -.2332344 A3 | -1.486818 .0911129 -16.318 0.000 -1.665396 -1.30824 A4 | -1.276604 .0866417 -14.734 0.000 -1.446419 -1.106789 A5 | -2.351855 .1187645 -19.803 0.000 -2.584629 -2.119081 A6 | -3.046888 .1624834 -18.752 0.000 -3.36535 -2.728427 B2 | -.4921212 .0717497 -6.859 0.000 -.632748 -.3514945 C2 | -1.749688 .1148437 -15.235 0.000 -1.974778 -1.524599 AB22 | -.0519126 .1118743 -0.464 0.643 -.2711822 .1673569 AB32 | 1.093616 .1141603 9.580 0.000 .8698657 1.317366 AB42 | 1.144115 .111572 10.254 0.000 .9254374 1.362792 AB52 | 1.563319 .1327219 11.779 0.000 1.303189 1.823449 AB62 | 3.15483 .1733711 18.197 0.000 2.815029 3.494631 AC22 | -1.36947 .2366924 -5.786 0.000 -1.833378 -.9055613 AC32 | 2.327229 .145237 16.024 0.000 2.042569 2.611888 AC42 | 1.625523 .1467546 11.076 0.000 1.337889 1.913157 AC52 | 2.450851 .1586213 15.451 0.000 2.139959 2.761743 AC62 | 1.634488 .1593321 10.258 0.000 1.322203 1.946774 BC22 | .0272588 .0867221 0.314 0.753 -.1427134 .1972309 ABC122 | -1.079335 .2766519 -3.901 0.000 -1.621563 -.5371074 _cons | 6.238325 .0441942 141.157 0.000 6.151706 6.324944 ------------------------------------------------------------------------------ The interpretation here is that there is strong evidence that department 1 rejects female candidates at a lower rate than in rejects male candidates. Once this is taken into account, there is no evidence for sex discrimination in any of the other departments (BC22 = 0.03, and G-squared = 2.473 on 4 df).