Scale back linear regression coefficients in R from scaled and centered data

后端 未结 3 1773
借酒劲吻你
借酒劲吻你 2021-01-06 09:16

I\'m fitting a linear model using OLS and have scaled my regressors with the function scale in R because of the different units of measure between variables. Then, I fit the

相关标签:
3条回答
  • 2021-01-06 09:53

    To de-scale or back-transform regression coefficients from a regression done with scaled predictor variable(s) and non-scaled response variable the intercept and slope should be calculated as:

    A = As - Bs*Xmean/sdx
    B = Bs/sdx
    

    thus the regression is,

    Y = As - Bs*Xmean/sdx + Bs/sdx * X
    

    where

    As = intercept from the scaled regression
    Bs = slope from the scaled regression
    Xmean = the mean of the scaled predictor variable
    sdx = the standard deviation of the predictor variable
    

    This can be adjusted if Y was also scaled but it appears you decided not to do that ultimately with your dataset.

    0 讨论(0)
  • 2021-01-06 10:02

    If I understand your description (that is unfortunately at the moment code-free), you are getting standardized regression coefficients for Y ~ As + Bs*Xs where all those "s" items are scaled variables. The coefficients then are the predicted change on a std deviation scale of Y associated with a change in X of one standard deviation of X. The scale function would have recorded the means and standard deviations in attributes for hte scaled object. If not, then you will have those estimates somewhere in your console log. The estimated change in dY for a change dX in X should be: dY*(1/sdY) = Bs*dX*(1/sdX). Predictions should be something along these lines:

    Yest = As*(sdX) + Xmn + Bs*(Xs)*(sdX)
    

    You probably should not have needed to standardize the Y values, and I'm hoping that you didn't because it makes dealing with the adjustment for the means of the X's easier. Put some code and example data in if you want implemented and checked answers. I think @DanielGerlance is correct in saying to multiply rather than divide by the SD's.

    0 讨论(0)
  • 2021-01-06 10:11

    If you used the scale function with default arguments then your regressors will be centered (subtracting their mean) and divided by their standard deviations. You can interpret the coefficients without transforming them back to the original units:

    Holding everything else constant, on average, a one standard deviation change in one of the regressors is associated with a change in the dependent variable corresponding to the coefficient of that regressor.

    If you have included an intercept term in your model keep in mind that the interpretation of the intercept will change. The estimated intercept now represents the average level of the dependent variable when all of the regressors are at their average levels. This is a result of subtracting the mean from each variable.

    To interpret the coefficients in non-standard deviation terms, just calculate the standard deviation of each regressor and multiple that by the coefficient.

    0 讨论(0)
提交回复
热议问题