BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I have run the exact same regression model in both GLM and Surveyreg. I then use the Contrast statement to perform an F-test for the difference between two coefficients. I am trying to figure out why the F-value is different between the two. Here is the code I run:

proc glm data=My_Data;
class CUSIP SIC2 YEAR;
model Y=X1 X2 CUSIP SIC2 YEAR / Solution;
contrast 'X1=X2' X1 1 X2 -1; run;

Output: F-value = 7.91, p-value = .0049


proc surveyreg data=My_Data;
class CUSIP SIC2 YEAR;
model Y=X1 X2 CUSIP SIC2 YEAR / Solution;
contrast 'X1=X2' X1 1 X2 -1; run;

Output: F-value = 3.93, p-value = .0474

The two regressions have the same parameter estimates, but different standard errors and t-statistics. Can you tell me what the difference is between surveyreg and GLM?

Thanks
3 REPLIES 3
statsplank
Calcite | Level 5
Hi MatthewSAS,

I did a little experiment on my own: fitted the same model with PROC GLM then with PROC SURVEYREG. I got same estimates of the regression coefficient but F-statistics and p-values were somewhat different.

Since it's the same model the reason must be the different methods used to estimate variance-covariance matrix of the regression coefficients - and yes, they are different. Here is some information I found in SAS/STAT(R) 9.2 User's Guide:

Variance estimation in PROC SURVEYREG
http://support.sas.com/documentation/cdl/en/statug/59654/HTML/default/statug_surveyreg_a0000000257.h...


Hypothesis testing in PROC GLM
http://support.sas.com/documentation/cdl/en/statug/59654/HTML/default/statug_glm_sect040.htm
statsplank
Calcite | Level 5
In addition, the number of degrees of freedom also could differ between the two procedures.
deleted_user
Not applicable
Thanks for the help. I appreciate it.

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
  • 3 replies
  • 2233 views
  • 0 likes
  • 2 in conversation