Help using Base SAS procedures

Proc GLM is not outputting ALL of intercepts

Reply
Occasional Contributor
Posts: 10

Proc GLM is not outputting ALL of intercepts

Hi

I am using a code like the following;

proc glm data=Samp;
class ID;
MODEL Y= X /solution; 
run;quit;

SAS is outputting the Coefficient on X and also the intercept on the "last" ID, however it's not outputting the intercepts on other ID levels.

Does anyone know what may have caused this?

P.S ; Samp dataset is sorted by ID prior to running PROC GLM.Also SAS log does not show me any errors or warnings on the GLM procedure.


Thanks!

Trusted Advisor
Posts: 1,231

Re: Proc GLM is not outputting ALL of intercepts

Use by ID to get the desired output.


proc glm data=Samp;

by ID;

MODEL Y= X /solution; 

run;quit;

Occasional Contributor
Posts: 10

Re: Proc GLM is not outputting ALL of intercepts

Thanks for your recommendation.

I was actually having a problem with ABSORB statement , so I thought I'd give the procedure a try with the CLASS statement, but it turned out it has a problem too.

So I was hoping if I can figure out why CLASS is not working then I can solve the other issue; becuase they could be interrelated.

Super User
Posts: 19,871

Re: Proc GLM is not outputting ALL of intercepts

Do you mean parameter estimates? It works for me? Are you sure there's no warnings in your output.

What does the following generate:

title 'Unbalanced Two-Way Analysis of Variance';

data a;

   input drug disease @;

   do i=1 to 6;

      input y @;

      output;

   end;

   datalines;

1 1 42 44 36 13 19 22

1 2 33  . 26  . 33 21

1 3 31 -3  . 25 25 24

2 1 28  . 23 34 42 13

2 2  . 34 33 31  . 36

2 3  3 26 28 32  4 16

3 1  .  .  1 29  . 19

3 2  . 11  9  7  1 -6

3 3 21  1  .  9  3  .

4 1 24  .  9 22 -2 15

4 2 27 12 12 -5 16 15

4 3 22  7 25  5 12  .

;

proc glm;

   class drug ;

   model y=drug/solution;

run;quit;

Occasional Contributor
Posts: 10

Re: Proc GLM is not outputting ALL of intercepts

Correct Reeza, I meant parameter estimates. I ran your code. Beside the four Coefficients,

it only provided one Intercept.

Super User
Posts: 19,871

Re: Proc GLM is not outputting ALL of intercepts

That is correct. The model is :

Y= Intercept + B1*(X=1) + B2(X=2) + B3(X=3)

What are you expecting?

Occasional Contributor
Posts: 10

Re: Proc GLM is not outputting ALL of intercepts

To my knowledge, the model should generate the individual fixed effects estimates ;iIntercepts vary person to person, however the coefficients remain the same.

Super User
Posts: 19,871

Re: Proc GLM is not outputting ALL of intercepts

Then perhaps start from the beginning, with what you're trying to do statistically. I'd post it as a new question as this subject line isn't valid anymore. 

Please include as much description as you can, it helps to answer your question correctly the first time.

Occasional Contributor
Posts: 10

Re: Proc GLM is not outputting ALL of intercepts

Thanks Reeze, I agree with your comment.

Ask a Question
Discussion stats
  • 8 replies
  • 286 views
  • 0 likes
  • 3 in conversation