BookmarkSubscribeRSS Feed
djw23
Calcite | Level 5

Hi there,

 

I am new to SAS and need help with a rather complex dataset that I have.  Basically,  I have four classification variables  and I want test the intereaction between them all (all 2 and 3-way interactions).  However, in order to select the best model for my analysis, I want to use the stepwise backward eliminaton reggression tool in the Predicitive Regression Model task (proc glmselect) to select the best model using the AIC criteria.    I've managed to successfully do this with my dataset, however I have two issues:

 

1)  I need to specify a random effect in the model but there is no way to select one in the UI of the PRM task.  Do I need to specify this in the code and is it possible?

 

Here is my code so far:

proc glmselect data=WORK.IMPORT outdesign(addinputvars)=Work.Glmselect_Design 
		plots=(criterionpanel(unpack) coefficientpanel);
	class Pre Post Adult Age / param=glm;
	model Caspase3=Pre Post Adult Age Pre*Post Pre*Adult Pre*Age Post*Adult 
		Post*Age Adult*Age Pre*Post*Adult Pre*Post*Age Pre*Adult*Age Post*Adult*Age / 
		stb selection=backward
(select=aic stop=aic choose=aic) hierarchy=single details=steps(anova fitstats);
	score out=WORK.Glmselect_stats predicted residual;
run;

proc reg data=Work.Glmselect_Design plots(only)=(diagnostics residuals 
		observedbypredicted);
	ods select DiagnosticsPanel ResidualPlot ObservedByPredicted;
	where Pre is not missing & Post is not missing & Adult is not missing & Age is 
		not missing;
	model Caspase3=&_GLSMOD /;
	run;
quit;

 

2)  Is there also a way to specify the distribution of the response as the majortiy of my datasets have residuals which not normally distributed.

 

Also on a sidenote, in the mixed model task (proc mixed), is there a way to specify the distribution here also?

 

Many thanks,

 

David

1 REPLY 1
Rick_SAS
SAS Super FREQ

1. If you want model selection in generalized linear models (link functions for response distributions), you can use the HPGENSELECT procedure.

2. SAS does not support automated variable selection for mixed models. However, some SAS programmers have wrapped macro code around SAS procedures to create their own selection algorithms. I don't recommend this approach, but you can find the papers in the SAS conference proceedings via an internet search for

     model selection mixed site:sas.com/proceedings

 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 1297 views
  • 0 likes
  • 2 in conversation