From 1f8c32a589f1a525ba315b82ba9f40da3b7b4f5b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 9 Oct 2024 17:19:38 +0000 Subject: [PATCH] Render site --- help.html | 8 ++++---- modules/Statistics/lab/Statistics_Lab.Rmd | 6 ++++-- modules/Statistics/lab/Statistics_Lab_Key.html | 13 +++++++++++-- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/help.html b/help.html index 96ab803b..61e2f80b 100644 --- a/help.html +++ b/help.html @@ -353,14 +353,14 @@

Why are my changes not taking effect? It’s making my results look

Here we are creating a new object from an existing one:

new_rivers <- sample(rivers, 5)
 new_rivers
-
## [1]  300  310 1243  215 1100
+
## [1] 2348  600  444  981  338

Using just this will only print the result and not actually change new_rivers:

new_rivers + 1
-
## [1]  301  311 1244  216 1101
+
## [1] 2349  601  445  982  339

If we want to modify new_rivers and save that modified version, then we need to reassign new_rivers like so:

new_rivers <- new_rivers + 1
 new_rivers
-
## [1]  301  311 1244  216 1101
+
## [1] 2349  601  445  982  339

If we forget to reassign this can cause subsequent steps to not work as expected because we will not be working with the data that has been modified.


@@ -409,7 +409,7 @@

Error: object ‘X’ not found

Make sure you run something like this, with the <- operator:

rivers2 <- new_rivers + 1
 rivers2
-
## [1]  302  312 1245  217 1102
+
## [1] 2350  602  446  983  340

diff --git a/modules/Statistics/lab/Statistics_Lab.Rmd b/modules/Statistics/lab/Statistics_Lab.Rmd index 29059757..e6d5666e 100644 --- a/modules/Statistics/lab/Statistics_Lab.Rmd +++ b/modules/Statistics/lab/Statistics_Lab.Rmd @@ -57,8 +57,8 @@ Change your code from 1.2 to add a few more variables: Perform a t-test to determine if there is evidence of a difference between low birth weight percentage (`LowBirthWeight`) in Los Angeles census tracts compared to San Diego: -* Create a subset of the data for CaliforniaCounty == "Los Angeles" -* Create a subset of the data for CaliforniaCounty == "San Diego" +* Create a subset of the data for `CaliforniaCounty == "Los Angeles"` +* Create a subset of the data for `CaliforniaCounty == "San Diego"` * `pull` the `LowBirthWeight` column for both subsets * Use `t.test` to compare the two pulled vectors * Print the results using the `tidy` function from the `broom` package @@ -141,6 +141,8 @@ Let's make `LowBirthWeight` into a binary variable, where over 5% low birth weig The following code creates a column `weight_cat` with TRUE/FALSE values. ```{r} +ces <- read_csv("https://daseh.org/data/CalEnviroScreen_data.csv") + ces_bw <- ces %>% mutate(weight_cat = LowBirthWeight > 5) diff --git a/modules/Statistics/lab/Statistics_Lab_Key.html b/modules/Statistics/lab/Statistics_Lab_Key.html index bedb3dcc..450d2807 100644 --- a/modules/Statistics/lab/Statistics_Lab_Key.html +++ b/modules/Statistics/lab/Statistics_Lab_Key.html @@ -225,8 +225,8 @@

1.3

1.4

Perform a t-test to determine if there is evidence of a difference between low birth weight percentage (LowBirthWeight) in Los Angeles census tracts compared to San Diego:

    -
  • Create a subset of the data for CaliforniaCounty == “Los Angeles”
  • -
  • Create a subset of the data for CaliforniaCounty == “San Diego”
  • +
  • Create a subset of the data for CaliforniaCounty == "Los Angeles"
  • +
  • Create a subset of the data for CaliforniaCounty == "San Diego"
  • pull the LowBirthWeight column for both subsets
  • Use t.test to compare the two pulled vectors
  • Print the results using the tidy function from the broom package
  • @@ -409,6 +409,15 @@

    P.3

    P.4

    Let’s make LowBirthWeight into a binary variable, where over 5% low birth weight is “TRUE”.

    The following code creates a column weight_cat with TRUE/FALSE values.

    +
    ces <- read_csv("https://daseh.org/data/CalEnviroScreen_data.csv")
    +
    ## Rows: 8035 Columns: 67
    +## ── Column specification ────────────────────────────────────────────────────────
    +## Delimiter: ","
    +## chr  (3): CaliforniaCounty, ApproxLocation, CES4.0PercRange
    +## dbl (64): CensusTract, ZIP, Longitude, Latitude, CES4.0Score, CES4.0Percenti...
    +## 
    +## ℹ Use `spec()` to retrieve the full column specification for this data.
    +## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
    ces_bw <- 
       ces %>% 
       mutate(weight_cat = LowBirthWeight > 5)