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?
@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.
I want to test: b1+b3=0, and b2+b4=0
but he addresses proc reg, not proc glm
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.
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
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.