SASPROGRAMMING HANDOUT #11 This handout will illustrate various options of PROC UNIVARIATE, PROC REG. We will use the GNP data set which is in the SASHELP library on every PC that has SAS/PC. The goal of this program is to test the linearity assumption in regression (GNP=a+b*INVEST). We will break up the independent variable (INVEST) into 5 categorical variables (0/1) based numbers of observations. It will then perform regression using these dummy variables, output the results, merge them with the midpoints of the cutpoints, and finally plot the estimates to see if the relationship is linear. LIBNAME JIM 'A:\'; RUN; DATA DGNP; SET JIM.GNP; ONE=1; PROC MEANS; RUN; PROC UNIVARIATE DATA=DGNP NOPRINT; VAR INVEST; OUTPUT OUT=AA PCTLPTS=0 20 40 60 80 100 PCTLPRE=P_; PROC PRINT DATA=AA; RUN; DATA BB; SET AA; ONE=1; DATA CC; MERGE DGNP BB; BY ONE; CAT1= ( P_0 <=INVEST=1; DATA PLOT; MERGE EE MIDPTS; BETA=LAG(BETA); IF GROUP=1 THEN BETA=0; PROC PRINT; VAR BETA MIDPT GROUP; PROC GPLOT; TITLE 'CATEGORICAL REGRESSION'; PLOT BETA*MIDPT; SYMBOL1 V=DOT I=STEPC; RUN;