BookmarkSubscribeRSS Feed
Noga
Calcite | Level 5

I am using proc GLM statement:

proc glm data=x;

absorb cusip;

class year;

model y= a1 a2 a3 b1 b2 b3 b4 year/solution NOINT;

run;

 

I want to test the statistical significance of the sum b1+b3 and the sum b2+b4.

How do I do that?

7 REPLIES 7
PaigeMiller
Diamond | Level 26

@Noga wrote:

I am using proc GLM statement:

proc glm data=x;

absorb cusip;

class year;

model y= a1 a2 a3 b1 b2 b3 b4 year/solution NOINT;

run;

 

I want to test the statistical significance of the sum b1+b3 and the sum b2+b4.

How do I do that?


"Statistical significance" is only defined relative to a specific hypothesis test. You didn't state an hypothesis you are trying to test.

--
Paige Miller
Noga
Calcite | Level 5

I want to test: b1+b3=0, and b2+b4=0

Noga
Calcite | Level 5

but he addresses proc reg, not proc glm

Rick_SAS
SAS Super FREQ

To test a hypothesis of a linear relationship between coefficients, you can use the ESTIMATE statement: SAS Help Center: ESTIMATE Statement

 

For example, the following DATA step simulates data from a linear regression model for which the coefficients for x1 and x3 are +2 and -2, respectively. Similarly, the coefficients for x2 and x4 are +1.5 and -1.5, respectively.  The ESTIMATE statements produce tables that show the estimate (and std error) for the differences of the coefficients:

%let N = 100;
data Full;
call streaminit(123);
do i = 1 to &N;
   x1 = rand("Normal", 25, 5);
   x2 = rand("Normal", 14, 2);
   x3 = rand("Normal", 40, 9);
   x4 = rand("Normal", 21, 7);
   eps = rand("normal", 0, 30);
   y = 17 + 2*x1 + 1.5*x2 - 2*x3 - 1.5*x4 + eps;
   output;
end;
keep x1-x4 y;
run;

proc glm data=Full;
model y = x1-x4 / solution clmparm;
estimate 'x1-x3' x1 1 x3 -1;
estimate 'x2-x4' x2 1 x4 -1;
ods select Estimates ParameterEstimates;
quit;

The results are the same as for the REG procedure, except the GLM procedure outputs the p-value as a t test statistic, whereas PROC REG uses an F test. 

Ksharp
Super User
Rick,
estimate 'x1-x3' x1 1 x2 -1;
should be
estimate 'x1-x3' x1 1 x3 -1;
Ksharp
Super User

Or you can make a new variable new=b1+b3;

and use this variable NEW to test its estimated coefficient is zero or not ,like others variables. ?

also calling @StatDave  @SteveDenham 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 7 replies
  • 935 views
  • 3 likes
  • 4 in conversation