ChangeMyName
ChangeMyName

Reputation: 7428

How to save regression coefficients to file in SAS?`

I am trying to carry out a logistic regression with SAS. I have few settings for the model, and try to compare the difference.

What I want to archieve is to output the estimated coefficients to a file. I think ODS maybe a promising way, but don't know how to use it.

Can anyone write me a simple example?

Thank you very much.

Upvotes: 2

Views: 16489

Answers (3)

Paul Davis
Paul Davis

Reputation: 11

for proc reg this doesn't work for me

Use proc reg OUTEST=b

proc reg data=a outest=b;
  model y=x1;
run;

other reg can get other parameters added to OUTEST.

Upvotes: 1

DomPazz
DomPazz

Reputation: 12465

To add a bit of additional color; ODS OUTPUT <NAME>=DATASET ... ; will save the output into the specified dataset.

Use ODS TRACE get the names of output tables. Information on the tables will be written to the log.

ods trace on;
ods output ParameterEstimates=estimates;
proc logistic data=test;
model y = i;
run;
ods trace off;

Upvotes: 3

scott
scott

Reputation: 2275

For Logistic:

proc logistic data = in descending outest = out;
  class rank / param=ref ;
  model admit = gre gpa rank;
run;

For proc reg:

proc reg data=a;
   model y z=x1 x2;
   output out=b
run;

for proc glm:

ods output Solution=parameters FitStatistics=fit;
proc glm data=hers;
model glucose = exercise ;
quit;
run;

Upvotes: 3

Related Questions