/* line 1*/ filename emp_CA 'd:\ginger\econ424\econ424web\econ424-final-emp-CA.csv'; *filename emp_CA 'N:\share\notes\sas-sample-program\econ424-final-emp-CA.csv'; /* line 2 */ data emp_CA; /* line 3 */ infile emp_CA firstobs=2 dlm=',' dsd; /* line 4 */ informat employ 15. county $20.; /* line 5 */ input year month sic2code employ county ; /* line 6 * run; /* sic2code is the standard two-digit industry coding system. It has the following values in our file: 52: building materials 53: general mechandise 54: food stores 56: apparel and accessories 57: furniture 58: eating and drinking places (i.e. restaurants) 59: mischanellous retail */ /* line 7 */ proc freq data=emp_CA; /* line 8 */ tables county; /* line 9 */ tables year*month; /* line 10 */ run; /* line 11 */ proc means data=emp_CA noprint nway; /* line 12 */ where sic2code in (54, 58); /* line 13 */ class county year month; /* line 14 */ var employ; /* line 15 */ output out=emp1 sum=x1; /* line 16 */ run; /* line 17 */ proc means data=emp_CA noprint nway; /* line 18 */ where (sic2code ne 54) and (sic2code ne 58); /* line 19 */ class county year month; /* line 20 */ var employ; /* line 21 */ output out=emp2 sum=x2; /* line 22 */ run; /* line 23 */ proc sort data=emp1; /* line 24 */ by year month county; /* line 25 */ run; /* line 26 */ proc sort data=emp2; /* line 27 */ by year month county; /* line 28 */ run; /* line 29 */ data emp_updt; /* line 30 */ merge emp1 emp2; /* line 31 */ by year month county; /* line 32 */ x3=x1-x2; /* line 33 */ if year<98 and county='Los Angeles CA' then gradecrd=0; /* line 34 */ else if year>98 and county='Los Angeles CA' then gradecrd=1; /* line 35 */ else if year=98 & month=1 and county='Los Angeles CA' then gradecrd=16/31; /* line 36 */ else if year=98 & month~=1 and county='Los Angeles CA' then gradecrd=1; /* line 37 */ else gradecrd=0; /* line 38 */ run; /* line 39 */ proc glm data=emp_updt; /* line 40 */ class county; /* line 41 */ model x1=county; /* line 42 */ means county /waller; /* line 43 */ means county /lsd; /* line 44 */ run; /* line 45 */ proc glm data=emp_updt; /* line 46 */ class county; /* line 47 */ model x3=county; /* line 48 */ means county / waller; /* line 49 */ means county / lsd; /* line 50 */ run; /* line 51 */ proc reg data=emp_updt; /* line 52 */ model x1=gradecrd; /* line 53 */ run; /* line 54 */ proc reg data=emp_updt; /* line 55 */ model x3=gradecrd; /* line 56 */ run; /* line 57 */ proc glm data=emp_updt; /* line 58 */ class year month; /* line 59 */ model x1=gradecrd year*month / solution; /* line 60 */ run; /* line 61 */ proc glm data=emp_updt; /* line 62 */ class year month; /* line 63 */ model x3=gradecrd year*month / solution; /* line 64 */ run;