* Clear existing data and working space clear all * Open data from bigblue server * use c:\eco304\mls2017chi.dta use https://bigblue.depaul.edu/jlee141/econdata/eco304/mls2017chi.dta * Log file to save output log using lab1output, replace log close type lab1output.smcl * Describe and list data desc list in 1/6 list houseid hprice sqft zip list houseid hprice if zip == 60618 * Tabluate for frequencies tab zip tab zip fireplace tab zip bedroom * Create new variables and labeling gen lhprice = log(hprice) gen sqyard = sqft/9 gen lsqft = log(sqft) gen age_sq = agebld*agebld label var hprice "House price in $" label var lhprice "Log of house price" label var sqyard "Square Yard" label var lsqft "Log of Square Feet" label var agebld "Age of House" label var age_sq "Square of Age" * Create dummy variables using the existing variables gen oldhouse= agebld > 65 tab oldhouse tab zip, gen(z) * Descriptive Statistics sum sum, detail sum hprice * Covariance and Correlation correlate hprice sqft , covariance correlate hprice sqft correlate hprice sqft if zip == 60002, covariance correlate hprice sqft if zip == 60002 * Confidence Interval and Hypothesis test ci mean hprice sqft ci mean hprice sqft, level(99) ttest hprice == 300000 * Charts hist hprice hist hprice, bin(16) hist hprice, bin(12) frequency hist hprice, bin(12) percent hist hprice if zip == 60618, bin(12) percent twoway (scatter hprice sqft) twoway (scatter hprice sqft) if hprice > 200000 twoway (scatter hprice sqft) if hprice < 200000 * Saving Data save c:\eco304\my_hprice