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

后端 未结 3 1772
借酒劲吻你
借酒劲吻你 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.

提交回复
热议问题