BookmarkSubscribeRSS Feed
BobSmith
Fluorite | Level 6

I have a model:

 

 

proc surveylogistic data=table;
  class year industry;
  model dep (descending) = x1 x2 x3 x4 x5 year industry /rsquare;
run;

To test if x1 is statistically different than x2, I do:

 

 

 

proc surveylogistic data=table;
  class year industry;
  model dep (descending) = x1 x2 x3 x4 x5 year industry /rsquare;
  test1: test x1 = x2;
run;

How do I do the same in PROC SURVEYREG? This does not work:

 

 

proc surveyreg data=table;
  class year industry;
  model dep (descending) = x1 x2 x3 x4 x5 year industry /solution rsquare;
  test1: test x1 = x2;
run;

The above throws an error, 

ERROR 22-322: Syntax error, expecting one of the following: a name, ;, (, *,
              -, /, :, @, _CHARACTER_, _CHAR_, _NUMERIC_, |.
ERROR 200-322: The symbol is not recognized and will be ignored

I'm looking to test if two coefficients in PROC SURVEYREG are statistically different from each other.

1 REPLY 1
SAS_Rob
SAS Employee

Since SURVEYREG does not have a TEST statement that will allow multiple effects on it. Instead you should use a CONTRAST statement instead.

 

test x1=x2;

 

which is the same as 

x1-x2=0

 

would translate to 
contrast 'test_label' x1 1 x2-1;

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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