《stata交叉分析》由会员分享,可在线阅读,更多相关《stata交叉分析(34页珍藏版)》请在金锄头文库上搜索。
1、Getting Started in Frequencies, Crosstab, Factor and Regression Analysis (ver. 2.0 beta, draft)Oscar Torres-Reyna Data Consultant otorresprinceton.eduhttp:/dss.princeton.edu/training/Case study: introSearch here in the home page for this datasetCodebook in two formatsDatasets, two formats: ACII and
2、SPSSMarginalsMetadataNOTE: When data is not available in Stata, you can download the SPSS portable (*.por), open it using SPSS (available at the DSS lab) and saving it as Stata.Total 1,053 100.00 1,053 100.00Female 552.611604 52.48 100.00 552.611604 52.48 100.00Male 500.388396 47.52 47.52 500.388396
3、 47.52 47.52ASK) Freq. Percent Cum.(DO NOT A. Gender . tab qa aweight=weight /*With weights*/. Total 1,053 100.00 1,053 100.00Female 560 53.18 100.00 560 53.18 100.00Male 493 46.82 46.82 493 46.82 46.82ASK) Freq. Percent Cum.(DO NOT A. Gender . tab qa /*No weights*/. Total 1,053 100.00 1,053 100.00(
4、VOL) Undecided/Dont know/no answer 78.61762284 7.47 100.0078.61762284 7.47 100.00(VOL) Other/Neither 20.5570831 1.95 92.53 20.5570831 1.95 92.53John McCain and Sarah Palin, the Republ 449.487545 42.69 90.58 449.487545 42.69 90.58Barack Obama and Joe Biden, the Democra 504.337749 47.90 47.90 504.3377
5、49 47.90 47.90Barack Freq. Percent Cum.held today and the candidates were Q5. If the Presidential election were . tab q5 aweight=weight /*With weights*/. Total 1,053 100.00 1,053 100.00(VOL) Undecided/Dont know/no answer 87 8.26 100.00 87 8.26 100.00(VOL) Other/Neither 21 1.99 91.74 21 1.99 91.74Joh
6、n McCain and Sarah Palin, the Republ 464 44.06 89.74 464 44.06 89.74Barack Obama and Joe Biden, the Democra 481 45.68 45.68 481 45.68 45.68Barack Freq. Percent Cum.held today and the candidates were Q5. If the Presidential election were . tab q5 /*No weights*/Case study: frequencies Distribution of
7、electoral preferences and gender. According to the codebook q5 has the electoral question and qa gender.NOTE: At this point, it is strongly recommended to open a log to keep a record of your work and to extract output, type: log using mywork.logYou could also open a do-file by typing doedit and copy
8、 your commands there.No weightsUsing weightsNo weightsUsing weights100.00 100.00 100.00 100.00 100.00 100.00 47.52 52.48 47.52 52.48 100.00 100.00 Total 500.3884 552.6116 500.3884 552.6116 1,053 1,053 5.59 9.16 5.59 9.16 7.47 7.47 35.59 64.41 35.59 64.41 100.00 100.00 (VOL) Undecided/Dont 27.980574
9、50.637048 27.980574 50.637048 78.617623 78.617623 2.01 1.90 2.01 1.90 1.95 1.95 48.92 51.08 48.92 51.08 100.00 100.00 (VOL) Other/Neither 10.055739 10.5013441 10.055739 10.5013441 20.557083 20.557083 50.55 35.57 50.55 35.57 42.69 42.69 56.27 43.73 56.27 43.73 100.00 100.00 John McCain and Sarah 252.
10、9313 196.55625 252.9313 196.55625 449.487545 449.487545 41.85 53.37 41.85 53.37 47.90 47.90 41.52 58.48 41.52 58.48 100.00 100.00 Barack Obama and Joe 209.42078 294.91697 209.42078 294.91697 504.33775 504.33775 Barack Male Female Totalthe candidates were ASK)were held today and A. Gender (DO NOTPres
11、idential election Q5. If the column percentage row percentage frequency Key . tab q5 qa aw=weight, col row /*Electoral preferences by gender*/Case study: Electoral preferences by genderCase study: Electoral preferences by age100.00 100.00 100.00 100.00 100.00 100.00 100.00 100.00 100.00 100.00 100.0
12、0 100.00 100.00 100.00 3.59 4.97 9.45 8.59 9.76 23.80 16.26 3.59 4.97 9.45 8.59 9.76 23.80 16.26 Total 37.845325 52.312241 99.540836 90.454747 102.7289 250.600407 171.24932 37.845325 52.312241 99.540836 90.454747 102.7289 250.600407 171.24932 5.99 7.05 1.82 5.08 8.33 7.16 7.75 5.99 7.05 1.82 5.08 8.33 7.16 7.75 2.88 4.69 2.30 5.84 10.88 22.84 16.87 2.88 4.69 2.30 5.84 10.88 22.84 16.87 (VOL) Undecided/Dont 2.2672181 3.6879373 1.809561 4.5920698 8.5570854