Skip to content

Commit e5095f0

Browse files
committed
unname() observed statistic when calculating p-value
closes #517
1 parent 2de3305 commit e5095f0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

vignettes/t_test.Rmd

+2-2
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ Note that this pipeline to calculate an observed statistic includes a call to `h
116116
Then, juxtaposing that $t$ statistic with its associated distribution using the `pt` function:
117117

118118
```{r}
119-
pt(observed_statistic, df = nrow(gss) - 1, lower.tail = FALSE)*2
119+
pt(unname(observed_statistic), df = nrow(gss) - 1, lower.tail = FALSE)*2
120120
```
121121

122122
Note that the resulting $t$-statistics from these two theory-based approaches are the same.
@@ -223,7 +223,7 @@ Note that this pipeline to calculate an observed statistic includes `hypothesize
223223
Then, juxtaposing that $t$ statistic with its associated distribution using the `pt` function:
224224

225225
```{r}
226-
pt(observed_statistic, df = nrow(gss) - 2, lower.tail = FALSE)*2
226+
pt(unname(observed_statistic), df = nrow(gss) - 2, lower.tail = FALSE)*2
227227
```
228228

229229
Note that the results from these two theory-based approaches are nearly the same.

0 commit comments

Comments
 (0)