# Intercept in lm() and theory not agreeing in simple linear regression example

I have data $$y_i,x_i$$ and the model $$y_i=\alpha x_i^\beta + \epsilon_i$$ where $$\log{\epsilon_i} \in N(0,\sigma^2)$$. Thus, I define $$z_i=\log{y_i}$$ and $$w_i=\log{x_i}$$ and my normal linear model becomes $$z_i=\log{\alpha}+\beta w_i+\log{\epsilon_i}$$.

The LSE and MLE of $$\log{\alpha}$$ should be $$\log{\hat{\alpha}}=\bar{z}$$. This is roughly 1.5 with the data below. However, the intercept, assuming that is $$\log{\hat{\alpha}}$$, is around 0.6. Am I interpreting this correctly?

x<-c(2,3,4,5,6,7,8,9,10,11)
y<-c(2.1,4,3.7,4.5,5,4.8,5.1,5.7,5.7,5.6)

w<-log(x)
z<-log(y)

mean(z)

fit<-lm(z~w)
summary(fit)

[1] 1.495164

Call:
lm(formula = z ~ w)

Residuals:
Min       1Q   Median       3Q      Max
-0.22232 -0.03190 -0.01444  0.06492  0.21840

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept)  0.61614    0.13723   4.490 0.002029 **
w            0.50223    0.07509   6.689 0.000154 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.1249 on 8 degrees of freedom
Multiple R-squared:  0.8483,    Adjusted R-squared:  0.8293
F-statistic: 44.74 on 1 and 8 DF,  p-value: 0.0001545

• The MLE for the $log\ a$ shouldn't be $\hat{log \ a}=\bar{z}-\hat{b}\bar{w}$ ?? – Fiodor1234 Jan 24 at 12:13
• If $\theta_0=\log{\alpha}$, isn’t the MLE $\hat{\theta_0}=\bar{z}$? – schn Jan 24 at 12:37
• I calculated it and it is not equal to $\bar{z}$. Take a look on equation (5) stat.cmu.edu/~cshalizi/mreg/15/lectures/06/lecture-06.pdf. – Fiodor1234 Jan 24 at 12:43
• You are right. I assumed a different linear model with terms $(w_i-\bar{w})$ instead of $w_i$. If you add it as an answer, I can accept it. – schn Jan 24 at 16:32
• I have another question related to this problem concerning confidence intervals, see stats.stackexchange.com/q/507568/263915 – schn Feb 1 at 18:50

In the case where you assume that your independent variate is of the form $$w_{i}$$, then the MLE will be $$\hat{log \ a}=\bar{z}-\hat{b}\bar{w}$$. However, as you stated, if you take as independent variate the centred one $$(w_{i}-\bar{w})$$ then you will take $$\hat{log \ a}=\bar{z}$$. Because after calculating the derivative of Maximum Likelihood the term $$\hat{b}\sum_{i=1}^{n}(w_{i}-\bar{w})$$ will be zero.