You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: book/02-stats-review.qmd
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -4622,7 +4622,7 @@ ggplot(
4622
4622
),
4623
4623
panel.grid.minor = element_blank(),
4624
4624
legend.spacing.x = unit(2.2, "cm"),
4625
-
legend.box.spacing = unit(2.5, "cm")
4625
+
legend.box.spacing = unit(1.2, "cm")
4626
4626
) +
4627
4627
labs(
4628
4628
x = "\n Number of chocolate preferences out of 10 children",
@@ -7566,7 +7566,7 @@ These two approaches lead to the same reject-or-fail-to-reject decision when the
7566
7566
| **Left-tailed** | $\theta < \theta_0$ | Reject $H_0$ if $p\text{-value}\leq \alpha$. | Reject $H_0$ if $z_{\operatorname{obs}} \leq z_{\alpha}$. |
7567
7567
| **Two-sided** | $\theta \neq \theta_0$ | Reject $H_0$ if $p\text{-value}\leq \alpha$. | Reject $H_0$ if $|z_{\operatorname{obs}}| \geq z_{1-\alpha/2}$. |
7568
7568
7569
-
: Decision rules for common Normal-approximation tests. Here, $\theta$ denotes a generic parameter, $\theta_0$ denotes the null value, $z_{\operatorname{obs}}$ denotes the observed value of the standardized test statistic, and $z_q$ denotes the $q$th quantile of the standard Normal distribution. {#tbl-pvalue-critical-rules .striped .hover}
7569
+
: Decision rules for common Normal-approximation tests. Here, $\theta$ denotes a generic parameter, $\theta_0$ denotes the null value, $z_{\operatorname{obs}}$ denotes the observed value of the standardized test statistic, and $z_q$ denotes the $q$-quantile of the standard Normal distribution. {#tbl-pvalue-critical-rules .striped .hover}
7570
7570
7571
7571
For the ice cream case, we will use the first two rows of @tbl-pvalue-critical-rules. The **demand query** is right-tailed because the alternative is $H_1 \text{: }\pi>0.50$. On the other hand, the **time query** is left-tailed because the alternative is $H_1 \text{: }\mu<12$. The two-sided row will become useful when we discuss confidence intervals and, later in the cookbook, two-sided tests for regression coefficients.
7572
7572
@@ -7691,7 +7691,7 @@ The above code output provides the numerical details of the test. The plot in @f
7691
7691
7692
7692
```{r}
7693
7693
#| label: fig-demand-null-distribution
7694
-
#| fig-cap: "Null distribution for the demand-query test. The shaded right tail represents the p-value for the one-sided alternative that the chocolate-preference probability is larger than one half. Inferential results correspond to the R-based observed."
7694
+
#| fig-cap: "Null distribution for the demand-query test. The shaded right tail represents the p-value for the one-sided alternative that the chocolate-preference probability is larger than one half. Inferential results correspond to the R-based observed sample."
7695
7695
#| echo: false
7696
7696
#| message: false
7697
7697
#| warning: false
@@ -8022,7 +8022,7 @@ z_{0.975}
8022
8022
},
8023
8023
$$
8024
8024
8025
-
$z_q$ denotes the $q$th quantile of the standard Normal distribution. This interval uses the **estimated standard error** because the goal is uncertainty quantification around the estimate, **not testing a specific null value**. That is why the standard error here uses $\hat{\pi}_{\operatorname{MLE,obs}}$ rather than $\pi_0=0.50$.
8025
+
$z_q$ denotes the $q$-quantile of the standard Normal distribution. This interval uses the **estimated standard error** because the goal is uncertainty quantification around the estimate, **not testing a specific null value**. That is why the standard error here uses $\hat{\pi}_{\operatorname{MLE,obs}}$ rather than $\pi_0=0.50$.
8026
8026
8027
8027
For the **time query**, the CLT-based 95% confidence interval for $\mu$ is
8028
8028
@@ -8033,7 +8033,7 @@ z_{0.975}
8033
8033
\frac{s_T}{\sqrt{n_t}},
8034
8034
$$
8035
8035
8036
-
where $z_q$ denotes the $q$th quantile of the standard Normal distribution.
8036
+
where $z_q$ denotes the $q$-quantile of the standard Normal distribution.
8037
8037
8038
8038
Note that both intervals are two-sided because they measure uncertainty above and below the observed estimates. The following code computes both intervals from the observed samples.
<p>These two approaches lead to the same reject-or-fail-to-reject decision when they are based on the same null distribution, alternative hypothesis, and significance level. <a href="#tbl-pvalue-critical-rules" class="quarto-xref">Table <span>2.30</span></a> summarizes the decision rules for common Normal-approximation tests. The important detail is that the rejection region depends on the direction of the alternative hypothesis. A right-tailed test looks for unusually large positive values of <span class="math inline">\(z_{\operatorname{obs}}\)</span>, a left-tailed test looks for unusually small negative values, and a two-sided test looks for values far from zero in either direction.</p>
Table 2.30: Decision rules for common Normal-approximation tests. Here, <span class="math inline">\(\theta\)</span> denotes a generic parameter, <span class="math inline">\(\theta_0\)</span> denotes the null value, <span class="math inline">\(z_{\operatorname{obs}}\)</span> denotes the observed value of the standardized test statistic, and <span class="math inline">\(z_q\)</span> denotes the <span class="math inline">\(q\)</span>th quantile of the standard Normal distribution.
7693
+
Table 2.30: Decision rules for common Normal-approximation tests. Here, <span class="math inline">\(\theta\)</span> denotes a generic parameter, <span class="math inline">\(\theta_0\)</span> denotes the null value, <span class="math inline">\(z_{\operatorname{obs}}\)</span> denotes the observed value of the standardized test statistic, and <span class="math inline">\(z_q\)</span> denotes the <span class="math inline">\(q\)</span>-quantile of the standard Normal distribution.
Figure 2.19: Null distribution for the demand-query test. The shaded right tail represents the p-value for the one-sided alternative that the chocolate-preference probability is larger than one half. Inferential results correspond to the R-based observed.
7889
+
Figure 2.19: Null distribution for the demand-query test. The shaded right tail represents the p-value for the one-sided alternative that the chocolate-preference probability is larger than one half. Inferential results correspond to the R-based observed sample.
<p><span class="math inline">\(z_q\)</span> denotes the <span class="math inline">\(q\)</span>th quantile of the standard Normal distribution. This interval uses the <strong>estimated standard error</strong> because the goal is uncertainty quantification around the estimate, <strong>not testing a specific null value</strong>. That is why the standard error here uses <span class="math inline">\(\hat{\pi}_{\operatorname{MLE,obs}}\)</span> rather than <span class="math inline">\(\pi_0=0.50\)</span>.</p>
8084
+
<p><span class="math inline">\(z_q\)</span> denotes the <span class="math inline">\(q\)</span>-quantile of the standard Normal distribution. This interval uses the <strong>estimated standard error</strong> because the goal is uncertainty quantification around the estimate, <strong>not testing a specific null value</strong>. That is why the standard error here uses <span class="math inline">\(\hat{\pi}_{\operatorname{MLE,obs}}\)</span> rather than <span class="math inline">\(\pi_0=0.50\)</span>.</p>
8085
8085
<p>For the <strong>time query</strong>, the CLT-based 95% confidence interval for <span class="math inline">\(\mu\)</span> is</p>
8086
8086
<p><span class="math display">\[
8087
8087
\hat{\mu}_{\operatorname{MLE,obs}}
8088
8088
\pm
8089
8089
z_{0.975}
8090
8090
\frac{s_T}{\sqrt{n_t}},
8091
8091
\]</span></p>
8092
-
<p>where <span class="math inline">\(z_q\)</span> denotes the <span class="math inline">\(q\)</span>th quantile of the standard Normal distribution.</p>
8092
+
<p>where <span class="math inline">\(z_q\)</span> denotes the <span class="math inline">\(q\)</span>-quantile of the standard Normal distribution.</p>
8093
8093
<p>Note that both intervals are two-sided because they measure uncertainty above and below the observed estimates. The following code computes both intervals from the observed samples.</p>
0 commit comments