turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Code for performing an F-test

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

04-16-2016 02:58 PM

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

04-16-2016 05:45 PM

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.