Consider following two regressions: in case A, I didn't transform dependent variable and in case B, I normalize the dependent variable to lie between 0 and 1. I was expecting the same output, but I didn't get.
`
sysuse auto,clear
//log transform price for both cases
qui gen lnprice=log(price)
qui sum lnprice
local lnprice_mean =r(mean)
local lnprice_sd =r(sd)`
qui sum turn
local turn_mean =r(mean)
local turn_sd =r(sd)
//normalize turn between 0 and 1; low means lower and high means higher : for only case B
qui gen turn_01=(turn-r(min))/(r(max)-r(min))
qui sum turn_01
local turn_01_mean= r(mean)
local turn_01_sd =r(sd)
//case A : run linear regression
reg turn lnprice weight
dis "since mean of turn is ", `turn_mean', ", sd of turn is ", `turn_sd' , ", and sd of lnprice is ",`lnprice_mean', ", 1 sd increase in lnprice" ///
" (equivalent to ", `lnprice_sd'*100, "percent increase in price) causes decrease in turn by ",_b[lnprice]*`lnprice_sd' , "unit. This is" ///
" equivalent to ", (_b[lnprice]*`lnprice_sd'/`turn_mean')*100," percent. It explains about ", (_b[lnprice]*`lnprice_sd'/`turn_sd')*100, " percent of" ///
" its overall sd."
//output:caseA
since mean of turn is 39.648649 , sd of turn is 4.3993537 , and sd of lnprice is 8.6406325 , 1 sd increase in lnprice (equivalent to 39.
210589 percent increase in price) causes decrease in turn by -.96306627 unit. This is equivalent to -2.4290015 percent. It explains about
-21.891085 percent of its overall sd.
//case B: run linear regression
reg turn_01 lnprice weight
dis "since mean of turn_01 is ", `turn_01_mean', ", sd of turn_01 is ", `turn_01_sd' , ", and sd of lnprice is ",`lnprice_mean', ", 1 sd increase in lnprice" ///
" (equivalent to ", `lnprice_sd'*100, "percent increase in price) causes decrease in turn_01 by ",_b[lnprice]*`lnprice_sd' , "unit. This is" ///
" equivalent to ", (_b[lnprice]*`lnprice_sd'/`turn_01_mean')*100," percent. It explains about ", (_b[lnprice]*`lnprice_sd'/`turn_01_sd')*100, " percent of" ///
" its overall sd."
//output: caseB
since mean of turn_01 is .43243244 , sd of turn_01 is .21996769 , and sd of lnprice is 8.6406325 , 1 sd increase in lnprice (equivalent to 39.
210589 percent increase in price) causes decrease in turn_01 by -.04815331 unit. This is equivalent to -11.135454 percent. It explains about
-21.891085 percent of its overall sd.
As you can see, I get -21.891085 in both cases (bold) for sd part. But in case A, I get -2.4290015 percent (bold) and in case B I get -11.135454 percent (bold) for mean part. I would appreciate if you could provide the reason for difference.
Thank you.
`
sysuse auto,clear
//log transform price for both cases
qui gen lnprice=log(price)
qui sum lnprice
local lnprice_mean =r(mean)
local lnprice_sd =r(sd)`
qui sum turn
local turn_mean =r(mean)
local turn_sd =r(sd)
//normalize turn between 0 and 1; low means lower and high means higher : for only case B
qui gen turn_01=(turn-r(min))/(r(max)-r(min))
qui sum turn_01
local turn_01_mean= r(mean)
local turn_01_sd =r(sd)
//case A : run linear regression
reg turn lnprice weight
dis "since mean of turn is ", `turn_mean', ", sd of turn is ", `turn_sd' , ", and sd of lnprice is ",`lnprice_mean', ", 1 sd increase in lnprice" ///
" (equivalent to ", `lnprice_sd'*100, "percent increase in price) causes decrease in turn by ",_b[lnprice]*`lnprice_sd' , "unit. This is" ///
" equivalent to ", (_b[lnprice]*`lnprice_sd'/`turn_mean')*100," percent. It explains about ", (_b[lnprice]*`lnprice_sd'/`turn_sd')*100, " percent of" ///
" its overall sd."
//output:caseA
since mean of turn is 39.648649 , sd of turn is 4.3993537 , and sd of lnprice is 8.6406325 , 1 sd increase in lnprice (equivalent to 39.
210589 percent increase in price) causes decrease in turn by -.96306627 unit. This is equivalent to -2.4290015 percent. It explains about
-21.891085 percent of its overall sd.
//case B: run linear regression
reg turn_01 lnprice weight
dis "since mean of turn_01 is ", `turn_01_mean', ", sd of turn_01 is ", `turn_01_sd' , ", and sd of lnprice is ",`lnprice_mean', ", 1 sd increase in lnprice" ///
" (equivalent to ", `lnprice_sd'*100, "percent increase in price) causes decrease in turn_01 by ",_b[lnprice]*`lnprice_sd' , "unit. This is" ///
" equivalent to ", (_b[lnprice]*`lnprice_sd'/`turn_01_mean')*100," percent. It explains about ", (_b[lnprice]*`lnprice_sd'/`turn_01_sd')*100, " percent of" ///
" its overall sd."
//output: caseB
since mean of turn_01 is .43243244 , sd of turn_01 is .21996769 , and sd of lnprice is 8.6406325 , 1 sd increase in lnprice (equivalent to 39.
210589 percent increase in price) causes decrease in turn_01 by -.04815331 unit. This is equivalent to -11.135454 percent. It explains about
-21.891085 percent of its overall sd.
As you can see, I get -21.891085 in both cases (bold) for sd part. But in case A, I get -2.4290015 percent (bold) and in case B I get -11.135454 percent (bold) for mean part. I would appreciate if you could provide the reason for difference.
Thank you.