# How to compute confidence interval in ANOVA with repeated measures?

I made a model using repeated measures univariate ANOVA in R.

> g <- aov(bis ~ x1 + x2 + bg.sol + x1:x2:I(bg.sol * k1) + Error(subject), coded)
> summary.lm(g$Within) Call: NULL Residuals: Min 1Q Median 3Q Max -24.7459 -4.8055 -0.1518 5.1696 17.6015 Coefficients: Estimate Std. Error t value Pr(>|t|) x1 3.1170 0.8444 3.691 0.000275 *** x2 -1.0906 0.1230 -8.864 < 2e-16 *** I(bg.sol * k1) 2.0522 1.0216 2.009 0.045645 * x1:x2:I(bg.sol * k1) -0.3191 0.1254 -2.545 0.011543 * --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 7.256 on 246 degrees of freedom Multiple R-squared: 0.2743, Adjusted R-squared: 0.2654 F-statistic: 30.99 on 3 and 246 DF, p-value: < 2.2e-16  I calculated confidence limit for each estimates. I thought SE * critical value would work. In case of x1 (continuous variable) 95% confidence limit was, > 0.8444 * qt(0.975, df = 1) [1] 10.72912  I'm wondering whether the calculated value is real confidence limit for x1. The estimates for x1 is 3.1170, and the limit is 10.72912. Plus-minus it includes zero value. But P-value showed value less than 0.05! I want to know where I made an error! • The confidence interval for x1 is 3.1170+c(-1,1)*qt(0.975, df=246)*0.8444, or$(1.45,4.78)\$. Your only issue is the degrees of freedom in your qt call. – assumednormal Aug 25 '12 at 10:13
• Hi, @Max, that seems to be the answer. Would you mind making it an official answer (& perhaps elaborating it a little) so we can upvote it & the OP can accept it? – gung Aug 25 '12 at 13:06
• Hi @Max, please do consider posting this as an answer! (Almost four years later, but still.) – amoeba May 12 '16 at 12:55
• @Max Would you mind writing this up into an official answer to close this thread? – Charlotte R Sep 20 '16 at 14:08
• @Max, do you want to turn your comment into an answer? – Stephan Kolassa Nov 6 '17 at 12:25