From 23165765c06c8014348d2e046efe33470b79569a Mon Sep 17 00:00:00 2001 From: sdwestwood <2135339w@student.gla.ac.uk> Date: Thu, 11 Jan 2024 03:42:50 +0000 Subject: [PATCH] adjusted gap from bottom on some code chunks --- index.html | 38 +++++++++++++++++++------------------- index.qmd | 16 ++++++++-------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/index.html b/index.html index d87d1ea..fd6e14a 100644 --- a/index.html +++ b/index.html @@ -671,8 +671,8 @@

Mean Function: Testing

test_data <- rnorm(n = 10, mean = 0, sd = 1)
 test_data
-
 [1]  1.3293398 -0.1874176 -0.9455704  0.8388746  2.1995362 -0.8723718
- [7] -0.1723302 -0.4131464 -0.4850704  0.5219714
+
 [1] -1.58839910  2.09802667 -1.02341586 -1.46741930  0.60332408  0.90148486
+ [7] -0.06074779  2.02160953  0.54964865 -1.73502848
@@ -690,7 +690,7 @@

Mean Function: Testing

# print the mean that our function calculates
 mean_function(test_data)
-
[1] 0.1813815
+
[1] 0.02990833
@@ -699,7 +699,7 @@

Mean Function: Testing

# print the mean that the base R function calculates
 mean(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

  1. 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

    1. 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 calculates
     var_function(test_data)
    -
    [1] 1.042024
    +
    [1] 2.077354
    @@ -974,7 +974,7 @@

    Variance Function: Testing

    # print the variance that the base R function calculates
     var(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){