turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- proc glm: estimate and contrast

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

05-27-2016 12:15 AM

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

05-27-2016 06:03 AM

The best place to start is the documentation of the ESTIMATE statement.

Since you are just getting started, you might want to read

CONTRAST and ESTIMATE Statements Made Easy:The LSMESTIMATE Statement

I also recommend