/* Filename: ForagerGroups.sas Purpose: SAS code for regression analysis of the Foraging Groups dataset from Kelley. Last Update: FDN 3.24.02 */ title1 'Forager Groups'; goptions reset=global gunit=in ftitle="garamond" ftext="garamond" htitle=.5 htext=.3; PROC IMPORT OUT= WORK.ForagerGroups DATAFILE= "F:\Courses\anth588\ForagerGroups.xls" DBMS=EXCEL2000 REPLACE; GETNAMES=YES; RUN; proc print; run; run; symbol1 color=blue value=dot height=.2; /* what do the distributions look like? */ proc univariate data=ForagerGroups; var aHunting aFishing aGathering; qqplot /normal( mu=est sigma=est); run; /*OK lets do some regressions -- we'll use REG, so can get the standardized betas */ title2 "Regression Analysis"; proc reg data=ForagerGroups; model Gathering= ET PP / stb; output out=regresults p=predicted r=residual ucl=PredictionUpperCL lcl=PredictionLowerCL uclm=MeanUpperCL lclm=MeanLowerCL; proc sort data=regresults; by logsize; /*plot the results -- including the residuals! */ proc gplot data=regresults; plot residual*predicted; run; proc univariate data=regresults ; var residual; qqplot residual /normal (mu=est sigma=est);