Skip to content

Commit

Permalink
Make 4 backticks -> 3 in code chunks
Browse files Browse the repository at this point in the history
  • Loading branch information
mine-cetinkaya-rundel committed Sep 10, 2023
1 parent a2d4177 commit ba8df18
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
6 changes: 3 additions & 3 deletions exercises/_05-ex-explore-numerical.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Indicate which of the plots show (a) a positive association, (b) a negative as
axis.text = element_blank()
) +
labs(x = NULL, y = NULL)
````
```

1. **Reproducing bacteria.**
Suppose that there is only sufficient space and nutrients to support one million bacterial cells in a petri dish.
Expand Down Expand Up @@ -504,7 +504,7 @@ Also shown below is a spatial intensity map of the same data.^[The [`county_comp
coord_quickmap()

p_hist + p_map + plot_layout(widths = c(1, 2))
````
```

a. Describe the numerical distribution and comment on whether a log transformation may be advisable for these data.

Expand Down Expand Up @@ -574,7 +574,7 @@ The US census collects data on race and ethnicity of Americans, among many other
p_hist + p_hist_log

p_map
````
```

a. Describe the numerical distribution and comment on why we might want to use log-transformed values in analyzing or modeling these data.

Expand Down
8 changes: 5 additions & 3 deletions exercises/_08-ex-model-mlr.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ The plots below show the predicted ROI vs. actual ROI for each of the genres sep
theme_minimal() +
labs(x = "Actual ROI", y = "Predicted ROI", color = "Genre") +
scale_color_openintro("five")
````
```

1. **Predicting baby weights.**
A more realistic approach to modeling baby weights is to consider all possibly related variables at once. Other variables of interest include length of pregnancy in weeks (`weeks`), mother's age in years (`mage`), the sex of the baby (`sex`), smoking status of the mother (`habit`), and the number of hospital (`visits`) visits during pregnancy. Below are three observations from this data set.
Expand Down Expand Up @@ -402,7 +402,8 @@ Below are the six models we evaluate and their adjusted $R^2$ values. [@data:bir
glance() %>%
pull(adj.r.squared) %>%
round(3)
````
```

- Predict `weight` from `mature`: `r m_mature`
- Predict `weight` from `weeks`: `r m_weeks`
- Predict `weight` from `visits`: `r m_visits`
Expand Down Expand Up @@ -441,7 +442,8 @@ Using body measurement and other relevant data on three species (*Adelie*, *Chin
glance() %>%
pull(adj.r.squared) %>%
round(3)
````
```

- Predict body mass from `bill_length_mm`: `r m_bl`
- Predict body mass from `bill_depth_mm`: `r m_bd`
- Predict body mass from `flipper_length_mm`: `r m_fl`
Expand Down
2 changes: 1 addition & 1 deletion exercises/_18-ex-inference-tables.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ In order to assess whether habitat conditions are related to the sunlight choice
add_header_above(c(" "=1, "sunlight" = 3, " " = 1)) %>%
column_spec(1:5, width = "5em") %>%
add_header_above(c("Original data" = 5))
````
```

Then, the data were randomized once, where sunlight preference was randomly assigned to the lizards across different sites. The results of the randomization is shown below.

Expand Down
4 changes: 2 additions & 2 deletions exercises/_20-ex-inference-two-means.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ Below are some summary statistics from this dataset along with box plots showing
labs(y = "Feed type", x = "Weight (in grams)")

p_box + p_hist
````
```

::: {.content-hidden unless-format="pdf"}
*See next page for parts a to d.*
Expand Down Expand Up @@ -442,7 +442,7 @@ If your hypothesis test yields a statistically significant result, discuss wheth
kable_styling(bootstrap_options = c("striped", "condensed"),
latex_options = "HOLD_position",
full_width = FALSE)
````
```

\clearpage

Expand Down
4 changes: 2 additions & 2 deletions exercises/_24-ex-inf-model-slr.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ Many people believe that weight, drinking habits, and many other factors are muc
1. **Urban homeowners, conditions.**
The scatterplot below shows the percent of families who own their home vs. the percent of the population living in urban areas. [@data:urbanOwner] There are 52 observations, each corresponding to a state in the US. Puerto Rico and District of Columbia are also included.

````{r}
```{r}
#| out.width: 50%
#| fig.asp: 1.0
library(openintro)
Expand All @@ -576,7 +576,7 @@ The scatterplot below shows the percent of families who own their home vs. the p
cex.lab = 1.5, cex.axis = 1.5)

rsq_uo <- round(cor(urban_owner$poppct_urban, urban_owner$pct_owner_occupied), 2)^2*100
````
```

a. For these data, $R^2$ is `r rsq_uo`%. What is the value of the correlation coefficient? How can you tell if it is positive or negative?

Expand Down

0 comments on commit ba8df18

Please sign in to comment.