BookmarkSubscribeRSS Feed
adrfinance
Obsidian | Level 7

I am using a weighted logistic regression of the form:

 

rsubmit;
proc logistic data=dataset_1 outest=stepwise_ot;
model dependent_variable(event="1") = var1 var2 var3 var4 var5 var6 var7 / selection = stepwise
details expb stb lackfit rsquare;
weight correct_weight;
output out=Output_1 pred=PD Xbeta=logodds p=est_response;
store output_1;
run;
endrsubmit;

 

for the first row SAS gives me a value of the linear predictor equal to -1.118603402 while when I do the calculations in Excel through a linear relationship of the form intercept + b1*x1 + b2*x2 + ..... with the estimated coefficients I get -1,118603402... Could this be due to a rounding error? How does SAS calculate the value of the Linear Predictor?

2 REPLIES 2
PaigeMiller
Diamond | Level 26

@adrfinance wrote:



for the first row SAS gives me a value of the linear predictor equal to -1.118603402 while when I do the calculations in Excel through a linear relationship of the form intercept + b1*x1 + b2*x2 + ..... with the estimated coefficients I get -1,118603402... Could this be due to a rounding error? How does SAS calculate the value of the Linear Predictor?


I don't see a difference between the two numbers you show (except for the typographical error that one has a comma)

--
Paige Miller
mkeintz
PROC Star

You have trailing periods in your posted  excel result, suggesting you didn't bother to post more digits. 

 

Just because SAS printed the number you posted (-1.118603402) doesn't mean that is the exact value SAS generated.  It only means that the printed coefficient was subject to a specific format.   If your proc logistic also saved the estimate in a data set,  read the dataset and print it with a longer format.

 

It's likely  rounding, yes, but not a rounding ERROR.  It's just a display/printing convention that you can investigate.

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 262 views
  • 0 likes
  • 3 in conversation