NOTE: If you want to see the design effect or the misspecification effect, use estat effects after the command.
The data files used for the examples in this text can be downloaded in a .zip file from the Wiley Publications website. You can then use a program such as zip to unzip the data files. If you need assistance getting data into Stata, please see our Stata Class Notes, especially the unit on Entering Data. (NOTE: The *.dat files are the data files, and the *.txt files contain the codebook information.)
Table 6.2, page 216.
NOTE: You need to increase the amount of memory available to Stata before opening this data file because it is so large.
set mem 5m (5120k) use nhanes3.dta, clear
svyset SDPPSU6 [pweight = WTPFHX6], strata(SDPSTRA6) pweight: WTPFHX6 VCE: linearized Strata 1: SDPSTRA6 SU 1: SDPPSU6 FPC 1: <zero> xi: svy: logit HBP HSAGEIR HSSEX I.DMARACER BMPWTLBS BMPHTIN I.SMOKE I.DMARACER _IDMARACER_1-3 (naturally coded; _IDMARACER_1 omitted) I.SMOKE _ISMOKE_1-3 (naturally coded; _ISMOKE_1 omitted) (running logit on estimation sample) Survey: Logistic regression Number of strata = 49 Number of obs = 16963 Number of PSUs = 98 Population size = 1.772e+08 Design df = 49 F( 8, 42) = 193.50 Prob > F = 0.0000 ------------------------------------------------------------------------------ | Linearized HBP | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- HSAGEIR | .0807254 .0024847 32.49 0.000 .0757323 .0857185 HSSEX | .2040417 .0754752 2.70 0.009 .0523686 .3557149 _IDMARACER_2 | .558488 .0743918 7.51 0.000 .4089921 .7079839 _IDMARACER_3 | .0436902 .3004571 0.15 0.885 -.5601009 .6474814 BMPWTLBS | .0116062 .0008349 13.90 0.000 .0099284 .013284 BMPHTIN | -.0592606 .0126097 -4.70 0.000 -.0846008 -.0339204 _ISMOKE_2 | -.0764019 .0949624 -0.80 0.425 -.2672361 .1144323 _ISMOKE_3 | .0610105 .1050502 0.58 0.564 -.1500959 .2721169 _cons | -4.257218 .8040119 -5.29 0.000 -5.87294 -2.641496 ------------------------------------------------------------------------------
Table 6.3 , page 218.
svy: logit HBP HSAGEIR HSSEX _IDMARACER_2 _IDMARACER_3 BMPWTLBS BMPHTIN (running logit on estimation sample) Survey: Logistic regression Number of strata = 49 Number of obs = 16964 Number of PSUs = 98 Population size = 1.772e+08 Design df = 49 F( 6, 44) = 205.76 Prob > F = 0.0000 ------------------------------------------------------------------------------ | Linearized HBP | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- HSAGEIR | .0799522 .0026616 30.04 0.000 .0746036 .0853008 HSSEX | .1938372 .0790581 2.45 0.018 .0349641 .3527104 _IDMARACER_2 | .5715161 .0709902 8.05 0.000 .4288559 .7141762 _IDMARACER_3 | .0519777 .3006959 0.17 0.863 -.5522933 .6562486 BMPWTLBS | .0114421 .0008405 13.61 0.000 .0097531 .0131311 BMPHTIN | -.0589891 .0126859 -4.65 0.000 -.0844824 -.0334958 _cons | -4.211455 .7940002 -5.30 0.000 -5.807058 -2.615852 ------------------------------------------------------------------------------
Table 6.43, page 219.
logit HBP HSAGEIR HSSEX _IDMARACER_2 _IDMARACER_3 BMPWTLBS BMPHTIN Iteration 0: log likelihood = -8602.8989 Iteration 1: log likelihood = -6870.2255 Iteration 2: log likelihood = -6671.2868 Iteration 3: log likelihood = -6663.7359 Iteration 4: log likelihood = -6663.7081 Logit estimates Number of obs = 16964 LR chi2(6) = 3878.38 Prob > chi2 = 0.0000 Log likelihood = -6663.7081 Pseudo R2 = 0.2254 ------------------------------------------------------------------------------ HBP | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- HSAGEIR | .0696379 .0013966 49.86 0.000 .0669007 .0723751 HSSEX | .0904745 .0613365 1.48 0.140 -.0297429 .2106919 _IDMARACER_2 | .4765584 .0509377 9.36 0.000 .3767225 .5763944 _IDMARACER_3 | .0916109 .1430926 0.64 0.522 -.1888453 .3720672 BMPWTLBS | .0083715 .0006091 13.74 0.000 .0071776 .0095654 BMPHTIN | -.0451575 .0085049 -5.31 0.000 -.0618268 -.0284882 _cons | -3.871509 .529282 -7.31 0.000 -4.908883 -2.834135 ------------------------------------------------------------------------------
Table 6.5, page 221.
Design-based analysis:
svy: logit HBP HSAGEIR HSSEX _IDMARACER_2 _IDMARACER_3 BMPWTLBS BMPHTIN, or (running logit on estimation sample) Survey: Logistic regression Number of strata = 49 Number of obs = 16964 Number of PSUs = 98 Population size = 1.772e+08 Design df = 49 F( 6, 44) = 205.76 Prob > F = 0.0000 ------------------------------------------------------------------------------ | Linearized HBP | Odds Ratio Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- HSAGEIR | 1.083235 .0028831 30.04 0.000 1.077457 1.089045 HSSEX | 1.213899 .0959685 2.45 0.018 1.035583 1.422919 _IDMARACER_2 | 1.77095 .1257201 8.05 0.000 1.5355 2.042503 _IDMARACER_3 | 1.053352 .3167386 0.17 0.863 .5756282 1.927548 BMPWTLBS | 1.011508 .0008502 13.61 0.000 1.009801 1.013218 BMPHTIN | .942717 .0119592 -4.65 0.000 .9189878 .9670589 ------------------------------------------------------------------------------
Model-based analysis:
logit HBP HSAGEIR HSSEX _IDMARACER_2 _IDMARACER_3 BMPWTLBS BMPHTIN, or Iteration 0: log likelihood = -8602.8989 Iteration 1: log likelihood = -6870.2255 Iteration 2: log likelihood = -6671.2868 Iteration 3: log likelihood = -6663.7359 Iteration 4: log likelihood = -6663.7081 Logit estimates Number of obs = 16964 LR chi2(6) = 3878.38 Prob > chi2 = 0.0000 Log likelihood = -6663.7081 Pseudo R2 = 0.2254 ------------------------------------------------------------------------------ HBP | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- HSAGEIR | 1.07212 .0014973 49.86 0.000 1.069189 1.075059 HSSEX | 1.094694 .0671447 1.48 0.140 .9706951 1.234532 _IDMARACER_2 | 1.610522 .0820362 9.36 0.000 1.4575 1.77961 _IDMARACER_3 | 1.095938 .1568206 0.64 0.522 .8279146 1.45073 BMPWTLBS | 1.008407 .0006142 13.74 0.000 1.007203 1.009611 BMPHTIN | .9558469 .0081294 -5.31 0.000 .9400457 .9719138 ------------------------------------------------------------------------------