<ol>
<li>Standard error is not sd but se. Standard error is related to sd but they are not the same <span class="math-container">$\text{se}=\frac{sd}{\sqrt{n}}$</span>. You can also confirm here that in the first case <span class="math-container">$1.41\approx 4.46/\sqrt{10}$</span></li>
<li>Confidence interval is, for 95% confidence and using t-statistics, <span class="math-container">$\pm t^* \cdot\text{se}$</span>, <strong>not</strong> <span class="math-container">$\pm 1.96\cdot se$</span>.</li>
</ol>
<p>The critical value of <span class="math-container">$t^*$</span> at 95% level depends on number of observations, it will be 1.96 only when <span class="math-container">$n \rightarrow \infty$</span>. But the table clearly shows that you have mere 10 observations in all groups. For 10 observations critical <span class="math-container">$t$</span>-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: <span class="math-container">$\pm 2.3 \cdot 1.41 \approx \pm 3.2 $</span>. So their confidence intervals are correct.</p>

CC BY-SA 4.0
2021-10-13T22:04:17.617Z
2021-10-13T22:04:17.617Z
1muflon1
<p>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</p>
<p>Confident interval +/- standard error*1.96</p>
<p>However, today, when reading a <a href="http://www.cookbook-r.com/Graphs/Plotting_means_and_error_bars_(ggplot2)/" rel="nofollow noreferrer">R code</a>, I saw their code is:</p>
<pre><code># summarySE provides the standard deviation, standard error of the mean, and a (default 95%) confidence interval
tgc &lt;- summarySE(tg, measurevar=&quot;len&quot;, groupvars=c(&quot;supp&quot;,&quot;dose&quot;))
tgc
#&gt;   supp dose  N   len       sd        se       ci
#&gt; 1   OJ  0.5 10 13.23 4.459709 1.4102837 3.190283
#&gt; 2   OJ  1.0 10 22.70 3.910953 1.2367520 2.797727
#&gt; 3   OJ  2.0 10 26.06 2.655058 0.8396031 1.899314
#&gt; 4   VC  0.5 10  7.98 2.746634 0.8685620 1.964824
#&gt; 5   VC  1.0 10 16.77 2.515309 0.7954104 1.799343
#&gt; 6   VC  2.0 10 26.14 4.797731 1.5171757 3.432090
</code></pre>
<p>From what I understand, <strong>sd</strong> is standard error and <strong>ci</strong> is confidence interval, and <strong>len</strong> is the variable of interest. I am wondering how can they have the <strong>ci</strong> like in that case.</p>

<applied-econometrics><r>
Why there is only one value of confidence interval?
Nguyen Lis
# Why there is only one value of confidence interval?

(Asked by: username_0 on 2021-10-13)

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.

**Tags:** applied-econometrics, r


---

## 1 answers

### Answer by username_1 on 2021-10-13. Score: 3 | Accepted answer

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.


---

