BookmarkSubscribeRSS Feed
JOLSAS
Quartz | Level 8

Hi all,

 

I have the following SAS codes:

 

proc sort data=dataset1; by d1; run;

proc glm data=dataset1;
   class f1 f2;
   by d1;
   model dep = indep1 indep2 f1 f2 /solution;
   estimate 'test' indep1 1 -1 indep2 1 -1;
run; quit;

 

What I'm trying to do is a fixed effect regression, with f1 and f2 being the fixed effect, indep1 and indep2 being the independent variables. I also want to do the regression for two sub-samples: those with d1=1, and those with d1=0. d1 is a dummy variable that equals 1 for half the dataset, and 0 for the other half.

 

The output is two sets of regression results. One set is for those observations with d1=1, and the other for those with d1=0.

I want to test the following two hypotheses:

 

beta1 in group (d1=1)=beta1 in group (d1=0), beta1 being the coefficient of indep1;

beta2 in group (d1=1)=beta2 in group (d1=0), beta2 being the coefficient of indep2;

 

For each set of output, I got one 'test' results, with different t-values.

In the log file, I also got the error message " More coefficients than levels specified for effect indep1. Some coefficients will be ignored", " More coefficients than levels specified for effect indep2. Some coefficients will be ignored"

 

I'm just beginning to learn to use estimate and/or contrast statements. So below are my questions:

 

a. what is the difference between estimate and contrast statement? When should I use estimate, and when contrast?

b. How can I correctly test the following two hypotheses:

 

beta1 in group (d1=1)=beta1 in group (d1=0), beta1 being the coefficient of indep1;

beta2 in group (d1=1)=beta2 in group (d1=0), beta2 being the coefficient of indep2;

 

I've been googling a lot for this and didn't get the help I needed. So I'm hoping someone here could help me with this. Very much appreciated!

 

J

1 REPLY 1

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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