# print the mean that our function calculatesmean_function(test_data)
-
[1] 0.1813815
+
[1] 0.02990833
@@ -699,7 +699,7 @@
Mean Function: Testing
# print the mean that the base R function calculatesmean(test_data)
-
[1] 0.1813815
+
[1] 0.02990833
@@ -739,7 +739,7 @@
Variance Function: Input
A vector of numeric values (x)
-
+
var_function <-function(x){
@@ -765,7 +765,7 @@
Variance Function: Process
Calculate the mean of x using our mean_function()
-
+
var_function <-function(x){
@@ -794,7 +794,7 @@
Variance Function: Process
subtract the mean from each value of x
-
+
var_function <-function(x){
@@ -824,7 +824,7 @@
Variance Function: Process
square each of the resulting values
-
+
var_function <-function(x){
@@ -855,7 +855,7 @@
Variance Function: Process
sum all of the squared values together
-
+
var_function <-function(x){
@@ -881,7 +881,7 @@
Variance Function: Process
Calculate the bottom part (denominator) of the formula
-
+
var_function <-function(x){
@@ -908,7 +908,7 @@
Variance Function: Process
Calculate the bottom part (denominator) of the formula
Divide the numerator by the denominator
-
+
var_function <-function(x){
@@ -934,7 +934,7 @@
Variance Function: Process
Variance Function: Output
Return the resulting value from Step 4 in the process
-
+
var_function <-function(x){
@@ -965,7 +965,7 @@
Variance Function: Testing
# print the variance that our function calculatesvar_function(test_data)
-
[1] 1.042024
+
[1] 2.077354
@@ -974,7 +974,7 @@
Variance Function: Testing
# print the variance that the base R function calculatesvar(test_data)
-
[1] 1.042024
+
[1] 2.077354
@@ -1199,8 +1199,8 @@
A familiar scenario
# A tibble: 2 × 2
Group ReactionT
<chr> <dbl>
-1 G1 338.
-2 G1 298.
+1 G1 560.
+2 G1 330.
@@ -1293,13 +1293,13 @@
Introduce errors just like you introduce a function
Welch Two Sample t-test
data: ReactionT by Group
-t = -1.7074, df = 14.324, p-value = 0.1093
+t = -0.31153, df = 16.336, p-value = 0.7593
alternative hypothesis: true difference in means between group G1 and group G2 is not equal to 0
95 percent confidence interval:
- -240.36909 27.03854
+ -219.4492 163.1324
sample estimates:
mean in group G1 mean in group G2
- 444.5159 551.1812
+ 527.7605 555.9189
diff --git a/index.qmd b/index.qmd
index 3bc818b..c7bb8d2 100644
--- a/index.qmd
+++ b/index.qmd
@@ -317,7 +317,7 @@ $$\sigma^2 = \frac{\sum(x - \bar{x})^2}{n-1}$$
::: fragment
A vector of numeric values (`x`)
:::
-::: {.absolute top="400" left="0" width=700 height="300"}
+::: {.absolute top="380" left="0" width=700 height="300"}
```{r}
var_function <- function(x){
@@ -343,7 +343,7 @@ $$
1. Calculate the mean of `x` using our `mean_function()`
-::: {.absolute top="400" left="0" width=700 height="300"}
+::: {.absolute top="380" left="0" width=700 height="300"}
```{r}
var_function <- function(x){
@@ -371,7 +371,7 @@ $$
1. subtract the mean from each value of x
-::: {.absolute top="400" left="0" width=700 height="300"}
+::: {.absolute top="380" left="0" width=700 height="300"}
```{r}
var_function <- function(x){
@@ -400,7 +400,7 @@ $$
1. subtract the mean from each value of x
2. square each of the resulting values
-::: {.absolute top="400" left="0" width=700 height="300"}
+::: {.absolute top="380" left="0" width=700 height="300"}
```{r}
var_function <- function(x){
@@ -430,7 +430,7 @@ $$
2. square each of the resulting values
3. sum all of the squared values together
-::: {.absolute top="400" left="0" width=700 height="300"}
+::: {.absolute top="380" left="0" width=700 height="300"}
```{r}
var_function <- function(x){
@@ -456,7 +456,7 @@ $$
3. Calculate the bottom part (denominator) of the formula
-::: {.absolute top="400" left="0" width=700 height="300"}
+::: {.absolute top="380" left="0" width=700 height="300"}
```{r}
var_function <- function(x){
@@ -483,7 +483,7 @@ $$
3. Calculate the bottom part (denominator) of the formula
4. Divide the numerator by the denominator
-::: {.absolute top="400" left="0" width=700 height="300"}
+::: {.absolute top="380" left="0" width=700 height="300"}
```{r}
var_function <- function(x){
@@ -511,7 +511,7 @@ $$
Return the resulting value from Step 4 in the process
-::: {.absolute top="400" left="0" width="700" height="300"}
+::: {.absolute top="380" left="0" width="700" height="300"}
```{r, eval=TRUE}
var_function <- function(x){