Hi, I'm taking a SAS class and we are doing statistical test programming. I'm trying to run a PROC TTEST on HISTCOR1 and AGE_P, where AGE_P was formatted into 2 groups, but technically there are three groups. There following is my code, with the format for AGE_P given by my professor. The PROC TTEST won't run because there's more than 2 levels, which makes no sense because my WHERE statement says to look only at 18 year old and older. OPTIONS NOFMTERR; RUN; LIBNAME Mydata 'U:\PUBHBIO 6270\Lab_12'; RUN; PROC CONTENTS DATA=Mydata.personsx08; RUN; PROC FORMAT; VALUE AGE_P_fmt 18-40='Younger Adults' 41>='Older Adults'; RUN; PROC TTEST DATA=Mydata.personsx08 ALPHA=0.05 SIDED=2; VAR HICOSTR1; WHERE HICOSTR1 not in (99997,99998,99999) AND AGE_P >=18; CLASS AGE_P; FORMAT AGE_P AGE_P_fmt.; TITLE "Mean out-of-pocket premium cost (Plan1): Younger Adults vs. Older Adults"; RUN;
... View more