BookmarkSubscribeRSS Feed
Xiyuan
Fluorite | Level 6

how to output only one table including the coefficient estimates for each group?

 proc glm;
      by group;
      class a;
      model y1-y5=a x(a);
      output out=pout predicted=py1-py5;
   run;

  

10 REPLIES 10
PaigeMiller
Diamond | Level 26

Try the /SOLUTION option in the MODEL Statement.

 

If that's not what you want then:

 

Explain further. What do you mean by "only one table including the coefficient estimates for each group"?


What is wrong with the output that you get?

--
Paige Miller
Xiyuan
Fluorite | Level 6
thanks i find this code helps
ods output ParameterEstimates=test1;
Xiyuan
Fluorite | Level 6
but i still have a problem

when regressing y on x1 and x3 with fixed effect ID AND date, why the result is null:
proc glm data=test ;
absorb id date;
model y=x1 x3/ solution int;
quit;run;

the data is uploading...
PaigeMiller
Diamond | Level 26

Why is WHAT result null? SHOW US a screen capture of the problem.

--
Paige Miller
Xiyuan
Fluorite | Level 6

here is the result  and this is stata 's result

y |     Coef.            Std. Err.            t         P>|t|             [95% Conf. Interval]
-------------+----------------------------------------------------------------
x1 |   0.0498584    0.0502977       0.99        0.322            -.0488068 .1485237
x3 |   0.0241822    0.0540281        0.45          0.655           -.0818006 .1301651

PaigeMiller
Diamond | Level 26

Post screen captures in your reply by clicking on the "Insert Photos" icon.

 

Some of us cannot download attachments. Other people will not download attachments.

--
Paige Miller
Xiyuan
Fluorite | Level 6

微信截图_20220330214659.jpgwhat about this

PaigeMiller
Diamond | Level 26

You have zero degrees of freedom for error. The model you have fit has the maximum number of parameters, and fits perfectly. 

 

So, without seeing the data (because I refuse to download files), I can't advise further. You need to provide A PORTION OF the data as SAS data step code in your message (not as a file that I should download), instructions are here. Probably the problem is due to the ABSORB statement, maybe you don't need both variables in there, maybe you should remove DATE, maybe you should eliminate that ABSORB statement, but I am guessing as I can't see the data.

--
Paige Miller
Xiyuan
Fluorite | Level 6

here is the sample data

Rick_SAS
SAS Super FREQ

Please include the NObs table. It is possible that you have no valid observations.

 

The problem could be that you read the data incorrectly. The data you attached seem to be invalid. They look like this:

31-Dec-03 77546 1 0 1 1
31-Dec-03 10104 1 0 1 1
31-Dec-03 77284 1 0 1 1

In your CSV file, there is only one column, which contains values like

"31-Dec-03 77546 1 0 1 1"

You need to make sure that those numbers are properly read into the variables in your program. Otherwise, the y, x1, and x3 variables might contain missing values. 

 

The other thing you can do is run the following and upload the results:

proc print data=test(obs=5);
var id date y x1 x3;
run;

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 10 replies
  • 887 views
  • 1 like
  • 3 in conversation