# UNC-Chapel Hill ECON 400 - Stata Assignment-1(pdf) (10 pages)

Previewing pages 1, 2, 3 of 10 page document
View Full Document

## Stata Assignment-1(pdf)

Previewing pages 1, 2, 3 of actual document.

View Full Document
View Full Document

## Stata Assignment-1(pdf)

34 views

Pages:
10
School:
University of North Carolina at Chapel Hill
Course:
Econ 400 - ELEM STATISTICS Lecture 3
Unformatted text preview:

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 2066 0 0124 0 7138 0 0654 0 0528 0 0152 0 6522 0 0046 0 8920 0 0072 0 8323 1 0000 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 75 90 95 99 11 12 13 14 Largest 15 15 15 16 Mean Std Dev 9 464692 2 457137 Variance Skewness Kurtosis 6 03752 355391 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 75 90 95 99 72 74 75 76 Largest 77 77 78 79 Mean Std Dev Variance Skewness Kurtosis 69 24205 3 769236 14 20714 2174858 2 333877 corr unisexShoeLength height covariance obs 878 unisex h height unisexShoe h 6 03752 height 7 94315 14 2071 Question 4a Covariance 7 94315 UnisexShoeLength Variance 6 03752 Heig ht Variance 14 20714 corr unisexShoeLength height obs 878 unisex h height unisexShoe h 1 0000 height 0 8577 1 0000 Question 4b Correlation 8577 regress unisexShoeLength height Source SS df MS Model 3894 74157 1 3894 74157 Residual 1400 1639 876 1 59836061 Total 5294 90547 877 6 03752049 Number of obs F 1 876 Prob F R squared Adj R squared Root MSE 878 2436 71 0 0000 0 7356 0 7353 1 2643 unisexShoe h Coef Std Err t P t 95 Conf Interval height 5590958 0113262 49 36 0 000 5368661 5813255 cons 29 24825 7854092 37 24 0 000 30 78975 27 70674 0 5 10 15 Question 4c lfit Slope 5590958 Intercept 29 24825 scatter unisexShoeLength height lfitci unisexShoeLength height 60 65 70 height unisexShoeLength Fitted values 75 95 CI 80 Question 5 tab classification male row Key frequency row percentage Academic Dummy variable for classifica being male tion 0 1 Total 1 10 13 23 43 48 56 52 100 00 2 82 174 256 32 03 67 97 100 00 3 145 345 490 29 59 70 41 100 00 4 37 72 109 33 94 66 06 100 00 Total 274 604 878 31 21 68 79 100 00 Question 5c While most years are consistent with the overall distribution of male and females 1 3 female 2 3male the first year has a disproportionately large percentage of females compar ed to other years Question 6 gen gradYear 878 missing values generated replace gradYear 2016 if semester 1 classification 4 semester 2 classification 4 54 real changes made replace gradYear 2017 if semester 1 classification 3 semester 2 classification 3 semester 3 classification 4 250 real changes made replace gradYear 2018 if semester 1 classification 2 semester 2 classification 2 semester 3 classification 3 semes ter 4 classification 4 287 real changes made replace gradYear 2019 if semester 1 classification 1 semester 2 classification 1 semester 3 classification 2 semes ter 4 classification 3 220 real changes made replace gradYear 2020 if semester 3 classification 1 semester 4 classification 2 64 real changes made replace gradYear 2021 if semester 4 classification 1 3 real changes made tab gradYear gradYear Freq Percent Cum 2016 54 6 15 6 15 2017 250 28 47 34 62 2018 287 32 69 67 31 2019 220 25 06 92 37 2020 64 7 29 99 66 2021 3 0 34 100 00 Total 878 100 00 Question 7 gen bJan birthmonth if birthmonth 1 816 missing values generated gen bFeb birthmonth if birthmonth 2 805 missing values generated gen bMar birthmonth if birthmonth 3 801 missing values generated gen bApr birthmonth if birthmonth 4 807 missing values generated gen bMay birthmonth if birthmonth 5 800 missing values generated gen bJune birthmonth if birthmonth 6 …

View Full Document

## Access the best Study Guides, Lecture Notes and Practice Exams

Unlocking...
Sign Up

Join to view Stata Assignment-1(pdf) and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?