

Regression coefficients and coding di... 

Message/Author 

Xu, Man posted on Friday, February 01, 2013  5:55 am



This seems quite basic but I was puzzled by some analysis in relation to changes in coding directions of a predictor. I have a continuous outcome variable y, and a predictor variable x which has three levels: 0, 1, 2. I wanted to flip the direction of x and create a new variable called xr. I recode such that 0 in x now is 2 in xr, and 2 in x becomes 0 xr. Values of 1 remains the same. I run two regression model, first with x as predictor of y, then with xr as preditor of y. I would expect coefficient of xr has the same magnitude as coefficient of x but with oppoisite signs, right? But somehow these two are not exactly the same, although the signs are opposite. I was just wondering, is this normal or might there be something wrong that I did? Thanks! 


You should get the same coefficient value with the opposite sign. You either made a mistake in the recoding or the sample size changed for some reason. 

Back to top 

