DATA Step, Macro, Functions and more

Making a plot to show the effect of interaction

Reply
Contributor
Posts: 48

Making a plot to show the effect of interaction

The multiple regression model is

E(Y)= beta0+beta1*X1+beta2*X2+beta3 X1*X2

We are reqired to make a plot to show the effect of interaction.

What kind of plot made by SAS will be good to  show the interaction effect? 

Could anybody offer me a hint? Thanks in advance.

 

Trusted Advisor
Posts: 1,913

Re: Making a plot to show the effect of interaction

If you perform this model fit in PROC GLM (or a bunch of other procedures), then using PROC PLM is an easy way to make an interaction plot using the EFFECTPLOT statement.

 

http://support.sas.com/documentation/cdl/en/statug/68162/HTML/default/viewer.htm#statug_plm_overview...

Contributor
Posts: 48

Re: Making a plot to show the effect of interaction

Posted in reply to PaigeMiller

Thank you!! It really helps. One more question not relate to this, but relate to my assignment. So I would like to consult you directly here.



We are required to use the F-test to perform a Forward stepwise selection procedure to decide whether to add an variable, and then use the Akaike Information Criterion(AIC) to check model selection?

The model fit is

E(Y)= beta0+beta1*X1+beta2*X2+beta3 X1*X2

 

I don't know how to calculate the AIC and how to perform Forward stepwise selection procedure in SAS. Do you have some examples similiar to this? I check the web again and again but failed to find some similiar procedure. If you could help me, that is really very appreciated.

Frequent Contributor
Posts: 130

Re: Making a plot to show the effect of interaction

The AIC is a default model statistic that SAS produces in the proc reg or proc glm/proc glmselect procedures.  To perform a Forward and Stepwise selection, you just need to use the option "selection=" after your model statement.  Below are links to help you with the different options with the proc reg and proc glm/proc glmselect procedures.

 

http://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_reg_sect006....

and http://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_reg_sect013....

 

OR

 

http://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_glm_sect007....

and http://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_glmselect_se...

Contributor
Posts: 48

Re: Making a plot to show the effect of interaction

[ Edited ]

Thank you very much, dear dcruik. You offer me a great help!

 

Frequent Contributor
Posts: 130

Re: Making a plot to show the effect of interaction

[ Edited ]

I'm not sure what procedure you are using, but you can try to specify the plots option like "plots(only)=(diagnositcs(stats=default aic sbc));" or even after your selection= option, you may be able to use an AIC option that will display the AIC for the models.  You will need to make sure you have the ods graphics on before using the plots= statement though.  Whichever procedure you are using, I would recommend Google searching the syntax on it and determining how to specify specific statistics to be produced and outputted.  Hope this helps!

Contributor
Posts: 48

Re: Making a plot to show the effect of interaction

Thank you, dear dcruik. It really helps. It's very nice of you.
Trusted Advisor
Posts: 1,913

Re: Making a plot to show the effect of interaction

[ Edited ]

DingDing wrote:
We are required to use the F-test to perform a Forward stepwise selection procedure to decide whether to add an variable, and then use the Akaike Information Criterion(AIC) to check model selection?

Time for a rant


Gosh, I really hate to hear things like this. Is there some reason to require Forward stepwise selection? This method has been shown in many different papers to be a poor method of model building. Or is this simply a homework assignment? (In which case, I don't understand why a professor would require a poor method of model building)


Rant off

Contributor
Posts: 48

Re: Making a plot to show the effect of interaction

Posted in reply to PaigeMiller
I am very sorry. This is indeed an assignment, since time is very limited to submit, and I don't have much time to go through everything and I thought I am not able to figure out this before the deadline, so I just post it here for a direct answer.
Ask a Question
Discussion stats
  • 8 replies
  • 251 views
  • 0 likes
  • 3 in conversation