Results 1 to 5 of 5

Math Help - Formula For Logarithmic Regression

  1. #1
    Newbie
    Joined
    May 2011
    Posts
    3

    Formula For Logarithmic Regression

    Hello, I am aware the final formula is y=a+blnx, however I don't know the formulas to find a and b. I searched around everywhere and all I can find is how to do it on a calculator. Once this is found, how can I find the coefficient of determination as well? Thank you
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Member
    Joined
    May 2011
    From
    Sacramento, CA
    Posts
    165
    Do you know how to do a normal linear regression? Do you know how to find the coefficient of determination (i.e., R^2) for a normal linear regression? If so, then think of this logarithmic transformation on X as just a standard X variable. In other words, let X^*=ln(X), and do the normal stuff for the linear regression:

    Y = a + bX^*

    The transformation doesn't change the methodology of a regression, only the interpretation of the results.
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    May 2011
    Posts
    3
    Quote Originally Posted by bryangoodrich View Post
    Do you know how to do a normal linear regression? Do you know how to find the coefficient of determination (i.e., R^2) for a normal linear regression? If so, then think of this logarithmic transformation on X as just a standard X variable. In other words, let X^*=ln(X), and do the normal stuff for the linear regression:

    Y = a + bX^*

    The transformation doesn't change the methodology of a regression, only the interpretation of the results.
    Thank you. However I am still getting a wrong result. Here is the dataset,

    Y=
    Code:
          1043       1148       1105       1218       1037       841       903       866       928       881       802       828       726
    X=
    Code:
          1       2       3       4       5       6       7       8       9       10       11       12       13
    For the linear regression I get -32.5x+1176 which is consistent with Excel. However when I get the log of all of the X values and perform the normal linear regression as you say I get 237.9ln(x)+637.6 when the correct answer according to Excel is -148ln(x)+1204.9. I am not sure what I am doing wrong. I should be using the natural log of x throughout all of the summation calculations that require x correct? Thank you
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Member
    Joined
    May 2011
    From
    Sacramento, CA
    Posts
    165
    You might want to check your calculations. I checked this in R and got the same results as Excel. See the code below. Results have been commented out.

    Code:
    y <- c(1043, 1148, 1105, 1218, 1037, 841, 903, 866, 928, 881, 802, 828, 726)
    x <- 1:13
    lnx <- log(x)
    (fit <- lm(y ~ x))           ## y = 1176 - 32.52*x
    
    #Call:
    #lm(formula = y ~ x)
    
    #Coefficients:
    #(Intercept)            x  
    #    1175.77       -32.52  
    
    (fit.log <- lm(y ~ lnx))     ## y = 1205 - 148*log(x)
    
    #Call:
    #lm(formula = y ~ lnx)
    
    #Coefficients:
    #(Intercept)          lnx  
    #       1205         -148
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Newbie
    Joined
    May 2011
    Posts
    3
    Got it, thanks. The problem was my data-typing in my program, it was rounding the logged values.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Logarithmic Nonlinear Regression
    Posted in the Advanced Statistics Forum
    Replies: 9
    Last Post: September 14th 2011, 12:43 AM
  2. Ncaaf multiple regression/ stepwise regression
    Posted in the Advanced Statistics Forum
    Replies: 0
    Last Post: August 10th 2011, 07:21 AM
  3. simplifying to bivariate regression formula
    Posted in the Advanced Statistics Forum
    Replies: 2
    Last Post: January 18th 2010, 05:29 PM
  4. Regression SS in multiple linear regression
    Posted in the Advanced Statistics Forum
    Replies: 0
    Last Post: June 20th 2009, 01:23 PM
  5. slope formula for est. regression equatios
    Posted in the Statistics Forum
    Replies: 2
    Last Post: April 12th 2009, 12:36 AM

/mathhelpforum @mathhelpforum