BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
neuromeme1
Calcite | Level 5

Hello,

Could someone tell me how to write the code for an f-test.  The procedure I am trying to run consists of the following:

 

data class;
infile 'c:\prodata2.txt'expandtabs;
input y x1 x2 x3 x4 ;
proc means data=class;
var y x1 x2 x3 x4;
run;
proc reg;
model y=x1 x2 x3 x4/spec acov;
run;

 

proc reg;
model y=x1 x3/spec acov;
run;

 

What do I insert inbetween the first and second proc regs to run the f-test on the restricted model y=x1 x3.

 

Thank you in advance

 

1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

Hello @neuromeme1,

 

I think, you want to test whether both x2 and x4 can be dropped from the full model. You can request this F-test by inserting the following statement after the MODEL statement of your first PROC REG step:

 

test x2, x4;

This is a shorthand notation for

 

 

test x2=0, x4=0;

which indicates the null hypothesis (that the regression coefficients of x2 and x4 are zero) more clearly.

 

For more details please refer to the documentation of the TEST statement.

 

View solution in original post

1 REPLY 1
FreelanceReinh
Jade | Level 19

Hello @neuromeme1,

 

I think, you want to test whether both x2 and x4 can be dropped from the full model. You can request this F-test by inserting the following statement after the MODEL statement of your first PROC REG step:

 

test x2, x4;

This is a shorthand notation for

 

 

test x2=0, x4=0;

which indicates the null hypothesis (that the regression coefficients of x2 and x4 are zero) more clearly.

 

For more details please refer to the documentation of the TEST statement.

 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 14691 views
  • 2 likes
  • 2 in conversation