------------------------------------------------------------------------------- name: <unnamed> log: /Users/willbarrett/Desktop/Stata Assignment-1.smcl log type: smcl opened on: 17 Sep 2017, 21:38:58 . do "/var/folders/rf/761x79c96vv66kl86m02_8jr0000gn/T//SD00398.000000" . cls . //**Part 1** . clear . use "/Users/willbarrett/Downloads/F17 Students E.dta" . //*Question #1* . //converts feet to inches, and makes height variable . gen height = ((12 * feet) + inches) . sum height Variable | Obs Mean Std. Dev. Min Max -------------+--------------------------------------------------------- height | 878 69.24205 3.769236 60 79 . //Question 1a. Mean= 69.24205in, Std.Dev.= 3.769236in . sum height if male == 1 Variable | Obs Mean Std. Dev. Min Max -------------+--------------------------------------------------------- height | 604 71.08106 2.687423 63 79 . sum height if male == 0 Variable | Obs Mean Std. Dev. Min Max -------------+--------------------------------------------------------- height | 274 65.18818 2.389734 60 72 . //Question 1b. Male: Mean= 71.08106in, Std.Dev.= 2.687423in; Female: Mean= 65 > .18818in, Std.Dev.= 2.389734in . gen twoDeviationsHeight = height if ((height <= 69.24205 + (2 * 3.769236)) & > (height >= (69.24205 - (2 * 3.769236)))) (22 missing values generated) . sum twoDeviationsHeight Variable | Obs Mean Std. Dev. Min Max -------------+--------------------------------------------------------- twoDeviati~t | 856 69.30727 3.566418 62 76 . //Question 1c. 97.49% of the data falls within 2 Std.Dev. of the mean (divide > the # of twoDeviationsHeight observations by the total # of height observati > ons). . //I would say this observation is consistent with the empirical rule, as it i > s fairly close to the expected observation given by the empirical rule (95%). . . //*Question #2* . sum shoelength Variable | Obs Mean Std. Dev. Min Max -------------+--------------------------------------------------------- shoelength | 878 9.932802 1.915857 5 16 . //Question 2a. Mean= 9.932802, Std.Dev.= 1.915857. sum shoelength if male == 1 Variable | Obs Mean Std. Dev. Min Max -------------+--------------------------------------------------------- shoelength | 604 10.84437 1.4062 7 16 . sum shoelength if male == 0 Variable | Obs Mean Std. Dev. Min Max -------------+--------------------------------------------------------- shoelength | 274 7.923358 1.237968 5 11 . //Question 2b. Male: Mean= 10.84437, Std.Dev.= 1.4062; Female: Mean= 7.923358 > , Std.Dev.= 1.237968 . gen twoDeviationsShoeLength = shoelength if ((shoelength <= 9.932802 + (2 * 1 > .915857)) & (shoelength >= (9.932802 - (2 * 1.915857)))) (47 missing values generated) . sum twoDeviationsShoeLength Variable | Obs Mean Std. Dev. Min Max -------------+--------------------------------------------------------- twoDeviati~h | 831 9.95367 1.675107 6.5 13 . //Question 2c. 94.65% of the data falls within 2 Std.Dev. of the mean (divide > the total # of twoDeviationsShoeLength observations by the total # of shoele > ngth observations) . gen femaleShoeLength = shoelength - 1.5 if male == 0 (604 missing values generated) . gen maleShoeLength = shoelength if male == 1 (274 missing values generated) . gen unisexShoeLength = maleShoeLength (274 missing values generated) . replace unisexShoeLength = femaleShoeLength if maleShoeLength == . (274 real changes made) . . //*Question #3* . pwcorr age height classification unisexShoeLength male left birthmonth, sig s > tar(.05) | age height classi~n unisex~h male left birthm~h -------------+--------------------------------------------------------------- age | 1.0000 | | height | 0.0111 1.0000 | 0.7426 | classifica~n | 0.6241* 0.0220 1.0000 | 0.0000 0.5159 | unisexShoe~h | 0.0253 0.8577* 0.0146 1.0000 | 0.4538 0.0000 0.6649 | male | 0.0448 0.7248* 0.0171 0.8341* 1.0000 | 0.1848 0.0000 0.6136 0.0000 | left | -0.0031 0.0785* 0.0464 0.0747* 0.1060* 1.0000 | 0.9267 0.0200 0.1692 0.0268 0.0017 |birthmonth | -0.0427 -0.0124 -0.0654 -0.0152 -0.0046 0.0072 1.0000 | 0.2066 0.7138 0.0528 0.6522 0.8920 0.8323 | . //Asterisk(*): denotes correlation coefficients with a p-value of .05 or lowe > r . //Question 3a. age/classification, height/unisexShoeLength, height/male, heig > ht/left, unisexShoeLength/male, unisexShoeLength/left, male/left . //Question 3b. . . //*Question #4* . sum unisexShoeLength, detail unisexShoeLength ------------------------------------------------------------- Percentiles Smallest 1% 4 3.5 5% 5.5 3.5 10% 6 3.5 Obs 878 25% 7.5 3.5 Sum of Wgt. 878 50% 10 Mean 9.464692 Largest Std. Dev. 2.457137 75% 11 15 90% 12 15 Variance 6.03752 95% 13 15 Skewness -.355391 99% 14 16 Kurtosis 2.330334 . sum height, detail height ------------------------------------------------------------- Percentiles Smallest 1% 61 60 5% 63 60 10% 64 60 Obs 878 25% 66 60 Sum of Wgt. 878 50% 70 Mean 69.24205 Largest Std. Dev. 3.769236 75% 72 77 90% 74 77 Variance 14.20714 95% 75 78
View Full Document