Why does linear regression on a duplicated set of data in R not match up to its theoretical standard errors? In the post:
What happens when you do a linear regression with duplicate response variables?
it says that if we replicated data twice, the standard errors should be reduced by a factor of $\frac{1}{\sqrt{2}}$. I have some sample data from the cars package I ran two regressions on, one with the original set, the other with the duplicated set.
> library(datasets)
> data(cars)
> mod1 = lm(dist ~ speed, data = cars)
> summary(mod1)
> mod2 = lm(rep(dist,2) ~ rep(speed,2), data = cars)
> summary(mod2)

The reported table for mod1 is
Coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept) -17.5791     6.7584  -2.601   0.0123 *  
speed         3.9324     0.4155   9.464 1.49e-12 ***
---

and the reported table for mod2 is
Coefficients:
              Estimate Std. Error t value Pr(>|t|)    
(Intercept)   -17.5791     4.7299  -3.717 0.000336 ***
rep(speed, 2)   3.9324     0.2908  13.523  < 2e-16 ***
---

As we can see, $\frac{0.4155}{\sqrt{2}} = 0.2938$, which is not equal to $0.2908$ in mod2's table. Is there a reason for this difference?

The difference is due to the d.f. in the denominator of the t-statistic.
The cars data has $n=50$. The d.f. in that first standard error is $48$. In the duplicated data, it's $98$. The ratio of $\sqrt{2}$ to $\sqrt{98/48}$ is $\sqrt{96/98}\approx 0.9897$ which is the factor by which the $0.4155/\sqrt{2}$ is off - about 1% - simply multiply that value by the $\sqrt{96/98}$ factor and you're right on the money. As $n$ grows this goes away.
