Hey Everyone, I am trying to create a macro variable where I perform a One-Way ANOVA. If the pvalue for the test of equal variance is less than 0.05 then do a welch anova. Note: I have not included the "else" part of the statement as yet. Here is my code: %macro group3(dsn,class,outcome); %let largestpvalue=; %if &largestpvalue le 0.05 %then %do; %let i=1; %let alloutcome=%scan(&outcome,&i); %let myoutcome=; %do %until (&alloutcome eq ); %put &largestpvalue; %let myoutcome=&myoutcome &alloutcome; title "&alloutcome."; proc glm data=&dsn; class &class; model &alloutcome=&class; ods output HovFTest=&alloutcome.; means &class/hovtest=levene(type=abs) welch; lsmeans &class; run; proc sql; select round(max(probF),.0001) as largestpvalue into:largestpvalue from &alloutcome.; quit;title; %let i=%eval(&i+1); %let alloutcome=%scan(&outcome,&i); %put &myoutcome; %end;%end; %mend group3; %group3(sashelp.iris,species,Sepallength sepalwidth Petallength petalwidth);
... View more