Skip to content

Commit 25a64ad

Browse files
committed
update all variable names
1 parent 528a1a3 commit 25a64ad

8 files changed

+21
-21
lines changed

exercises/07-pscores-using-exercises.qmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ seven_dwarfs <- seven_dwarfs_train_2018 |>
2121
filter(wait_hour == 9)
2222
2323
propensity_model <- glm(
24-
park_extra_magic_morning ~ day_ticket_season + park_close + day_temperature_high,
24+
park_extra_magic_morning ~ park_ticket_season + park_close + park_temperature_high,
2525
data = seven_dwarfs,
2626
family = binomial()
2727
)

exercises/08-pscores-diagnostics-exercises.qmd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ seven_dwarfs <- seven_dwarfs_train_2018 |>
2222
filter(wait_hour == 9)
2323
2424
propensity_model <- glm(
25-
park_extra_magic_morning ~ day_ticket_season + park_close + day_temperature_high,
25+
park_extra_magic_morning ~ park_ticket_season + park_close + park_temperature_high,
2626
data = seven_dwarfs,
2727
family = binomial()
2828
)
@@ -62,7 +62,7 @@ ggplot(
6262

6363
## Your Turn 2
6464

65-
Create an unweighted ECDF for `day_temperature_high` by whether or not the day had Extra Magic Hours.
65+
Create an unweighted ECDF for `park_temperature_high` by whether or not the day had Extra Magic Hours.
6666

6767
```{r}
6868
#| eval: false
@@ -77,7 +77,7 @@ ggplot(seven_dwarfs_ps, aes(x = ____, group = ____, color = factor(____))) +
7777
ylab("Proportion <= x")
7878
```
7979

80-
Create an weighted ECDF for `day_temperature_high` by whether or not the day had Extra Magic Hours.
80+
Create an weighted ECDF for `park_temperature_high` by whether or not the day had Extra Magic Hours.
8181

8282
```{r}
8383
#| eval: false

exercises/09-outcome-model-exercises.qmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ ipw_results |>
5757
mutate(
5858
estimate = map_dbl(
5959
boot_fits,
60-
# pull the `estimate` for `extra_magic_morning` for each fit
60+
# pull the `estimate` for `park_extra_magic_morning` for each fit
6161
\(.fit) .fit |>
6262
filter(term == "park_extra_magic_morning") |>
6363
pull(estimate)

exercises/10-continuous-g-computation-exercises.qmd

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ library(splines)
1313

1414
For this set of exercises, we'll use g-computation to calculate a causal effect for continuous exposures.
1515

16-
In the touringplans data set, we have information about the posted waiting times for rides. We also have a limited amount of data on the observed, actual times. The question that we will consider is this: Do posted wait times (`avg_spostmin`) for the Seven Dwarves Mine Train at 8 am affect actual wait times (`avg_sactmin`) at 9 am? Here’s our DAG:
16+
In the touringplans data set, we have information about the posted waiting times for rides. We also have a limited amount of data on the observed, actual times. The question that we will consider is this: Do posted wait times (`wait_minutes_posted_avg`) for the Seven Dwarves Mine Train at 8 am affect actual wait times (`wait_minutes_actual_avg`) at 9 am? Here’s our DAG:
1717

1818
```{r}
1919
#| echo: false
@@ -89,15 +89,15 @@ You don't need to update any code here, so just run this.
8989

9090
```{r}
9191
eight <- seven_dwarfs_train_2018 |>
92-
filter(hour == 8) |>
92+
filter(wait_hour == 8) |>
9393
select(-wait_minutes_actual_avg)
9494
9595
nine <- seven_dwarfs_train_2018 |>
96-
filter(hour == 9) |>
97-
select(date, wait_minutes_actual_avg)
96+
filter(wait_hour == 9) |>
97+
select(park_date, wait_minutes_actual_avg)
9898
9999
wait_times <- eight |>
100-
left_join(nine, by = "date") |>
100+
left_join(nine, by = "park_date") |>
101101
drop_na(wait_minutes_actual_avg)
102102
```
103103

exercises/14-bonus-continuous-pscores-exercises.qmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,10 @@ eight <- seven_dwarfs_train_2018 |>
9494
9595
nine <- seven_dwarfs_train_2018 |>
9696
filter(wait_hour == 9) |>
97-
select(date, wait_minutes_actual_avg)
97+
select(park_date, wait_minutes_actual_avg)
9898
9999
wait_times <- eight |>
100-
left_join(nine, by = "date") |>
100+
left_join(nine, by = "park_date") |>
101101
drop_na(wait_minutes_actual_avg)
102102
```
103103

slides/raw/08-pscore-diagnostics.qmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,8 @@ ggplot(df, aes(x = wt71, color = factor(qsmk))) +
178178

179179
`r countdown::countdown(minutes = 10)`
180180

181-
### Create an unweighted ECDF examining the `weather_wdwhigh` confounder by whether or not the day had Extra Magic Hours.
182-
### Create a weighted ECDF examining the `weather_wdwhigh` confounder
181+
### Create an unweighted ECDF examining the `park_temperature_high` confounder by whether or not the day had Extra Magic Hours.
182+
### Create a weighted ECDF examining the `park_temperature_high` confounder
183183

184184

185185
## {background-color="#23373B" .center .huge}

slides/raw/09-outcome-model.qmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ boot_estimate <- int_t(ipw_results, boot_fits) |>
143143

144144
`r countdown::countdown(minutes = 12)`
145145

146-
### Create a function called `ipw_fit` that fits the propensity score model and the weighted outcome model for the effect between `extra_magic_morning` and `avg_spostmin`
146+
### Create a function called `ipw_fit` that fits the propensity score model and the weighted outcome model for the effect between `park_extra_magic_morning` and `wait_minutes_posted_avg`
147147

148148
### Using the `bootstraps()` and `int_t()` functions to estimate the final effect.
149149

slides/raw/14-bonus-continuous-pscores.qmd

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,9 @@ dagify(
192192

193193
## *Your Turn 1*
194194

195-
### Fit a model using `lm()` with `avg_spostmin` as the outcome and the confounders identified in the DAG.
195+
### Fit a model using `lm()` with `wait_minutes_posted_avg` as the outcome and the confounders identified in the DAG.
196196
### Use `augment()` to add model predictions to the data frame
197-
### In `wt_ate()`, calculate the weights using `avg_postmin`, `.fitted`, and `.sigma`
197+
### In `wt_ate()`, calculate the weights using `wait_minutes_posted_avg`, `.fitted`, and `.sigma`
198198

199199
`r countdown::countdown(minutes = 5)`
200200

@@ -208,18 +208,18 @@ eight <- seven_dwarfs_train_2018 |>
208208
209209
nine <- seven_dwarfs_train_2018 |>
210210
filter(wait_hour == 9) |>
211-
select(date, wait_minutes_posted_avg)
211+
select(park_date, wait_minutes_posted_avg)
212212
213213
wait_times <- eight |>
214-
left_join(nine, by = "date") |>
214+
left_join(nine, by = "park_date") |>
215215
drop_na(wait_minutes_posted_avg)
216216
```
217217

218218
```{r}
219219
post_time_model <- lm(
220220
wait_minutes_posted_avg ~
221221
park_close + park_extra_magic_morning +
222-
day_temperature_high + day_ticket_season,
222+
park_temperature_high + park_ticket_season,
223223
data = wait_times
224224
)
225225
```
@@ -230,7 +230,7 @@ post_time_model <- lm(
230230
wait_times_wts <- post_time_model |>
231231
augment(data = wait_times) |>
232232
mutate(wts = wt_ate(
233-
avg_spostmin, .fitted, .sigma = .sigma
233+
wait_minutes_posted_avg, .fitted, .sigma = .sigma
234234
))
235235
```
236236

0 commit comments

Comments
 (0)