1
$\begingroup$

I am running a fixed effects panel regression as under

$y=a+bx+e,$

where y=dependant variable, $x$=control variables, $a$=individual effects, $b$=slope, $e$=error term.

I first ran the FE panel regression with variables in levels (that is without taking logarithm). Then I ran the FE panel regression with variables expressed in logs. Ideally since taking logs is just scaling of the variable, we should not expect any change in the sign and statistical significance of the coefficients, b. But I find that for some control variables, the coefficients have changed when I take the logs. Am I going wrong somewhere? Which version gives correct results?

$\endgroup$
4
  • $\begingroup$ Can you show us a subset of the values for your control/outcome variables? Are some of the values between 0 and 1? $\endgroup$ Commented Jun 17, 2020 at 21:17
  • $\begingroup$ @ThomasBilach Yes That is true. Here are the some of the values $\endgroup$
    – indu mann
    Commented Jun 17, 2020 at 21:27
  • $\begingroup$ @ThomasBilach Yes That is true.But I have not taken logs of dummy variables or categorical variables. Here are the some of the values country_id 1 year 2006 crar 0.0844 tier1_cap_rwa 0.0935 RoA 0.1183 RoE 0.1139 z_score 0.1238 reg ranges between 0 and 1 accept_dep ranges between 0 and 1 country ranges between 0-1 ofc 0-1 country_type 1-3 real_st_rate 0.16234 ef1_gdp 0.4900399 ef2_gdp 0.0595650 ef3_gdp 0.0000000 ef4_gdp 0.0035492 ef5_gdp 0.2157386 act_restrict 8 entry_req 7 cap_reg 6 ff 0.077 rol_index 1.77 rol_rank 0.10 $\endgroup$
    – indu mann
    Commented Jun 17, 2020 at 21:36
  • $\begingroup$ Your comment is somewhat inscrutable. Could you post your output? Also, which variable are you logging? $\endgroup$ Commented Jun 17, 2020 at 21:44

1 Answer 1

0
$\begingroup$

Log-transforming a value less than 1 results in a negative number. Here is a quick demonstration in R:

# Generating a sequence of values between 0 and 1 (inclusive), incrementing by 0.1

x <- seq(0, 1, by = 0.1)
x
[1] 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0

# Taking the log() of each value in this sequence

round(log(x), 2)
[1]  -Inf -2.30 -1.61 -1.20 -0.92 -0.69 -0.51 -0.36 -0.22 -0.11  0.00

It is entirely possible for the sign of a Pearson's correlation to flip as a consequence of logging observations between 0 and 1. In such contexts, it's possible for $\rho(X,Y)$ to flip sign if we $\log X$ or $\log Y$, or both. See below for a quick-and-dirty simulation. In each iteration, I assessed the correlation between 10 pairs of values. The correlation was preserved in 7 out of the 10 trials. Note, upon each draw of 10 observations, a subset fall between 0 and 1, which reverse in sign after the log transformation; this has the potential to influence the relationship between variables.

set.seed(13)

sims <- 10
levels <- vector(mode = "numeric", length = 10)  # storage for the numeric values in levels
logged <- vector(mode = "numeric", length = 10)  # storage for the "logged" numeric values

for (i in 1:sims) {
  x <- exp(rnorm(10)); y <- exp(rnorm(10))       # drawing 'positive' random deviates             

  levels[i] <- cor(x, y)                         # correlation in levels
  logged[i] <- cor(log(x), log(y))               # correlation of the logged values
}

flipped <- (levels > 0 & logged < 0) | (levels < 0 & logged > 0)
preserved <- !flipped

# Were the correlations between pairs preserved?

cbind(levels, logged, flipped, preserved)

           levels      logged flipped preserved
 [1,]  0.10728307 -0.01369591       1         0
 [2,]  0.93652958  0.62956976       0         1
 [3,]  0.01300703  0.07601658       0         1
 [4,] -0.06794333  0.37656387       1         0
 [5,]  0.17978986  0.27654877       0         1
 [6,]  0.19476326  0.54571601       0         1
 [7,] -0.09462134 -0.04706490       0         1
 [8,] -0.25225396 -0.40215868       0         1
 [9,] -0.20694668 -0.05695933       0         1
[10,] -0.04839709  0.08447948       1         0

Another example is when a transformation dampens an outlier that was exerting major leverage. Review the top answer here for a very simple and clear demonstration of this. If you're working with per capita rates (e.g., limited number of incidents per unit population) or proportions, then a log transformation can influence or even reverse the sign of a coefficient.

$\endgroup$
5
  • $\begingroup$ If the matter is statistically argued, we can never establish robustness in our regressions. The whole objective of a doing an regression with economic variables is to establish causality. If it lacks robustness just by log transformation, no referee will ever accept a paper. $\endgroup$
    – indu mann
    Commented Jun 18, 2020 at 4:51
  • $\begingroup$ Your question was focused on your coefficients and how a log transformation might affect the sign of the observed effect. Why did you log transform your control variables in the first place? Was it to facilitate interpretation? Did the levels have a discernible skew? $\endgroup$ Commented Jun 18, 2020 at 6:19
  • $\begingroup$ I think it may have to be statistically argued, especially when you’re log-transforming values less than 1. $\endgroup$ Commented Jun 18, 2020 at 7:11
  • $\begingroup$ I have already mentioned I am not log transforming values less than 1. It is against econometrics principle to do that. $\endgroup$
    – indu mann
    Commented Jun 18, 2020 at 8:04
  • $\begingroup$ @indumann I would update your post and show us the distributions of the variables you logged. This way we can diagnose the problem more precisely. I will adjust (remove) my answer if it doesn’t apply to your situation. $\endgroup$ Commented Jun 18, 2020 at 15:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.