0
$\begingroup$

As we know, we can calculate the confidence interval relating to standard errors and coefficients by that to get the high CIs and low CIs at 95% confidence interval

Confident interval +/- standard error*1.96

However, today, when reading a R code, I saw their code is:

# summarySE provides the standard deviation, standard error of the mean, and a (default 95%) confidence interval
tgc <- summarySE(tg, measurevar="len", groupvars=c("supp","dose"))
tgc
#>   supp dose  N   len       sd        se       ci
#> 1   OJ  0.5 10 13.23 4.459709 1.4102837 3.190283
#> 2   OJ  1.0 10 22.70 3.910953 1.2367520 2.797727
#> 3   OJ  2.0 10 26.06 2.655058 0.8396031 1.899314
#> 4   VC  0.5 10  7.98 2.746634 0.8685620 1.964824
#> 5   VC  1.0 10 16.77 2.515309 0.7954104 1.799343
#> 6   VC  2.0 10 26.14 4.797731 1.5171757 3.432090

From what I understand, sd is standard error and ci is confidence interval, and len is the variable of interest. I am wondering how can they have the ci like in that case.

$\endgroup$
3
$\begingroup$
  1. Standard error is not sd but se. Standard error is related to sd but they are not the same $\text{se}=\frac{sd}{\sqrt{n}}$. You can also confirm here that in the first case $1.41\approx 4.46/\sqrt{10}$
  2. Confidence interval is, for 95% confidence and using t-statistics, $\pm t^* \cdot\text{se}$, not $\pm 1.96\cdot se$.

The critical value of $t^*$ at 95% level depends on number of observations, it will be 1.96 only when $n \rightarrow \infty$. But the table clearly shows that you have mere 10 observations in all groups. For 10 observations critical $t$-stat is about 2.3. Hence for the group 1 CI will be approximately 2.3. If you just plug this into proper formula you see that the value is correct: $\pm 2.3 \cdot 1.41 \approx \pm 3.2 $. So their confidence intervals are correct.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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