# Confidence interval of a log-linear regression

AIM: Make a confidence interval statement on a log-linear regression

Interpreting Standard Deviation of Natural Log Transformed Data

Lognormal Regression?

But they do not tackle the confidence interval of log-linear regressions.

I have the following log-linear regression:

lm( log(n_capita) ~ edu_index_percent, data = full_maps_edu)

With the summary table:

Coefficients:
Estimate Std. Error t value            Pr(>|t|)
(Intercept)       -9.92029    0.38053   -26.1 <0.0000000000000002 ***
edu_index_percent  0.10345    0.00592    17.5 <0.0000000000000002 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 1.33 on 167 degrees of freedom
Multiple R-squared:  0.646, Adjusted R-squared:  0.644
F-statistic:  305 on 1 and 167 DF,  p-value: <0.0000000000000002


So far, I think it is correct to say:

• The geometric mean of n_capita is $$exp(-9.92029)=0.00004917$$
• A one unit increase in the edu_index_percentage, in this case, one percentage point, is expected to increase n_capita by $$exp(0.10345)-1*100=10.9$$ percent.

Now I would like to make a statement about the confidence interval, something like:

There is approximately a 95% change that the following interval contains the true value of the edu_index_percentage coefficient:

$$[0.10345-2*0.00592, 0.10345+2*0.00592]$$ $$[0.09161, 0.1153]$$ $$[exp(0.09161)-1,exp(0.1153)-1]$$ $$[0.096,0.122]$$

QUESTION: Since I have to exponentiate the Estimate to interpret, I know I also have to exponentiate the Std.Error. But when it comes to building the interval, I don't know at what point I should exponentiate.

In other words, is the interval $$[0.096,0.122]$$ correct?

I am afraid, the interpretation of the log-linear model is slightly different. In general terms, if one has the model

$$ln(Capital) =\beta_0 +\beta_1Education+\varepsilon,$$

then a one unit increase in $$Education$$ increases $$Capital$$ by $$\beta_1*100$$ percent. In your case that is always 10.345% independent of the exact value of $$Education$$. This generality is the beauty of a log-linear model.

The 95% confidence interval is also easy. It ranges in your case from an 100%*(0.10345-2*0.00592)=9.161% to (0.10345+2*0.00592)=11.529% increase of $$Capital$$ following an increase of $$Education$$ by one unit.

• @delcast: I was just wondering whether my answer worked for you? I am asking because I read your questions very briefly before responding and might have got some details of what you wanted wrong Jan 24, 2019 at 8:17
• I can't find any other resources online (textbooks) that explain confidence intervals for a log-linear regression so I'm going to take your word for it. Feb 5, 2019 at 8:36

Don't transform the standard error, instead construct the confidence interval with the raw estimate and SE. Once you have the confidence interval you can then transform to percent difference.

Here's an example using mtcars in R:

m <- lm(log(mpg) ~ wt, data = mtcars)
m
#>
#> Call:
#> lm(formula = log(mpg) ~ wt, data = mtcars)
#>
#> Coefficients:
#> (Intercept)           wt
#>      3.8319      -0.2718

output <- cbind(coef(m), confint(m))

percent_change <- function(x) (exp(x) - 1)*100

result <- percent_change(output)[2,]
names(result) <- c("%change", "lower","upper")

result
#>   %change     lower     upper
#> -23.79817 -27.59108 -19.80657


Note that the rule of multiplying your coefficient by 100 to get percent differences is only approximately correct if your coefficient is very small.

E.g.

percent_change(.06)
#> [1] 6.183655


It will give you really bad approximations for larger coefficients.

percent_change(.5)
#> [1] 64.87213


Just use the appropriate equation: $$(e^\beta -1)*100$$