Skip to content

Commit

Permalink
Merge pull request #231 from fhdsl/statsfix
Browse files Browse the repository at this point in the history
tweak to make sure blank lab will render
  • Loading branch information
avahoffman authored Oct 9, 2024
2 parents eb5bb87 + b9a95e4 commit 924b785
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions modules/Statistics/lab/Statistics_Lab_Key.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 924b785

Please sign in to comment.