BookmarkSubscribeRSS Feed
Kamash
Calcite | Level 5

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!

8 REPLIES 8
stat_sas
Ammonite | Level 13

Use by ID to get the desired output.


proc glm data=Samp;

by ID;

MODEL Y= X /solution; 

run;quit;

Kamash
Calcite | Level 5

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.

Reeza
Super User

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;

Kamash
Calcite | Level 5

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

it only provided one Intercept.

Reeza
Super User

That is correct. The model is :

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

What are you expecting?

Kamash
Calcite | Level 5

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

Reeza
Super User

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.

Kamash
Calcite | Level 5

Thanks Reeze, I agree with your comment.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 8 replies
  • 1434 views
  • 0 likes
  • 3 in conversation