From 2add87a878007b26ee5d6d109eab207235936698 Mon Sep 17 00:00:00 2001 From: avahoffman Date: Wed, 9 Oct 2024 13:01:15 -0400 Subject: [PATCH 1/2] tweak to make sure blank lab will render --- modules/Statistics/lab/Statistics_Lab_Key.Rmd | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/Statistics/lab/Statistics_Lab_Key.Rmd b/modules/Statistics/lab/Statistics_Lab_Key.Rmd index a913a429..04876b09 100644 --- a/modules/Statistics/lab/Statistics_Lab_Key.Rmd +++ b/modules/Statistics/lab/Statistics_Lab_Key.Rmd @@ -174,6 +174,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) From b9a95e4b277eced1072dde0ee42214ca6eb1f8f2 Mon Sep 17 00:00:00 2001 From: avahoffman Date: Wed, 9 Oct 2024 13:09:12 -0400 Subject: [PATCH 2/2] add backticks --- modules/Statistics/lab/Statistics_Lab_Key.Rmd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/Statistics/lab/Statistics_Lab_Key.Rmd b/modules/Statistics/lab/Statistics_Lab_Key.Rmd index 04876b09..60543287 100644 --- a/modules/Statistics/lab/Statistics_Lab_Key.Rmd +++ b/modules/Statistics/lab/Statistics_Lab_Key.Rmd @@ -65,8 +65,8 @@ cor(ces_sub, use = "complete.obs") 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