Statistical Procedures

Programming the statistical procedures from SAS
BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
jackice
Calcite | Level 5

Good afternoon, 

 

A rather dummy question, I transformed both y and x var to do a linear regression of Log(y) vs Log(x) - i got the SAS output on SAS studio v3.4 and want to know what to do with the Intercept value and slope value in order to build the true equation. How should I calculated the intercept and slop exactly please? And is SAS LOG(var) default to base 10, e or LN?  I wish to know, from this SAS output, what is the equation to be use to predict data from non transformed data... THANKS TO ALL !!! 

 

Parameter Estimates Variable DF Parameter
Estimate Standard
Error t Value Pr > |t| Standardized
Estimate Intercept 1 log_TT_bps_ 1

0.165250.500530.330.74190
1.048080.139557.51<.00010.56709

undefined
1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

I would suggest you try and we'll be happy to help. @lvm has laid out the calculation - replace the a with your intercept value and b with your slope. X is your independent variable.  

The following is the formula in SAS (**=exponent)

 

Y = a*(x**B);

 

I would also recommend doing it via a data step so you can trace it out if required. 

 

 

View solution in original post

9 REPLIES 9
ballardw
Super User

The SAS function LOG is natural log (base e). Use Log10 for base 10 or Log2 for base 2.

 

If you share the code you used to generate the parameters there might be some better options than creating the model equation by hand.

lvm
Rhodochrosite | Level 12 lvm
Rhodochrosite | Level 12

Using your intercept (a) and slope (b), you have log(y) = a + b*log(x).

So, use:

y = [exp(a)]*(x**b) = A*(x^b),

where A=exp(a).

jackice
Calcite | Level 5
Thanks to both ... I changed everything into Log10(y) vs Log10(x) - May lvm explain to me a bit more how to calculate the value then perhaps on a hand writing picture as its confusing with too many characters ;-))
jackice
Calcite | Level 5
from the sas Regression Log10(y) vs Log10(x)
My new Intercept is 0.00036 (sas output)
My new slope is 1.0075 (sas output)
...Im dreaming of an example calculation on these value PLEASE...will never thank enough ;-0)
Reeza
Super User

I would suggest you try and we'll be happy to help. @lvm has laid out the calculation - replace the a with your intercept value and b with your slope. X is your independent variable.  

The following is the formula in SAS (**=exponent)

 

Y = a*(x**B);

 

I would also recommend doing it via a data step so you can trace it out if required. 

 

 

lvm
Rhodochrosite | Level 12 lvm
Rhodochrosite | Level 12

Here is a clarification to Reeza's post. If a is the intercept from the log(y):log(x) regression, then y is given by

y = (10**a)*(x**b)

if one is using base 10. If one is using base e (natural log), then it is:

y = (e**a)*(x**b)

 

jackice
Calcite | Level 5
Thank you kindly
Reeza
Super User

@jackice @lvm has the correct answer, not me...if you can change it. 

jackice
Calcite | Level 5
Don’t worry - Im the one reaching out - case closed Tks

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 9 replies
  • 5302 views
  • 2 likes
  • 4 in conversation