FILENAME website HTTP 'http://www.public.asu.edu/~rgcox2/ECN410/data/poverty2000.xlsx'; data file; n=-1; infile website recfm=s nbyte=n length=len; input; file "poverty2000.xlsx" recfm=n; put _infile_ $varying32767. len; run; /* Variables in the data set are, p_poverty : proportion of the state's population that lives below the poverty line unemrate : unemployment rate expressed as a propotion p_rural : proportion of the population living in rural areas lnpcinc_adj : natural log of percapita income adjusted for inflation p_hs_grads_19plus : proportion of the state's population age 19 and over that are high school graduates state : the state */ PROC IMPORT OUT= WORK.poverty DATAFILE= "poverty2000.xlsx" DBMS=xlsx REPLACE; *RANGE="A1:D64"; /*sheet="NAME"*/ getnames=yes; RUN; proc means data=poverty; run; /* fixed effects, use dummy variables for the states*/ proc genmod data = poverty; class state /param=glm; model p_poverty= unemrate p_rural lnpcinc_adj p_hs_grads_19plus state; repeated subject=state; /*use this statement to obtain robust standard errors*/ *store p1; run; proc glmselect data=poverty; class state; model p_poverty= unemrate p_rural lnpcinc_adj p_hs_grads_19plus state / select = rsquare ; run; quit; proc glmselect data=poverty; class state; model p_poverty= unemrate p_rural lnpcinc_adj p_hs_grads_19plus state / select = AIC ; run; quit; /* random effects */ proc reg data=poverty; model p_poverty= unemrate p_rural lnpcinc_adj p_hs_grads_19plus; run; quit;