Skip to content

Commit e640002

Browse files
committed
Update analysis-model.R
1 parent a33c07a commit e640002

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

R/analysis-model.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ model_wis <- function(scoring_scale = "log", output_dir = "output") {
3131
m.data <- m.data |>
3232
mutate(Incidence = log(Incidence + 1))
3333
}
34-
outcomes <- unique(m.data$outcome_target)
34+
outcomes <- unique(m.data$epi_target)
3535

3636
# --- Model formula ---
3737
# Univariate for each explanatory variable
@@ -65,7 +65,7 @@ model_wis <- function(scoring_scale = "log", output_dir = "output") {
6565
map(\(outcome) {
6666
bam(
6767
formula = m.formula,
68-
data = m.data |> filter(outcome_target == outcome),
68+
data = m.data |> filter(epi_target == outcome),
6969
family = gaussian(link = "log"),
7070
method = "fREML",
7171
control = gam.control(trace = TRUE),
@@ -84,13 +84,13 @@ model_wis <- function(scoring_scale = "log", output_dir = "output") {
8484
# Extract estimates for random effects
8585
random_effects_uni <- m.fits_uni[!grepl("horizon|incidence", names(m.fits_uni))] |>
8686
map_depth(.depth = 2, ~ extract_ranef(.x)) |>
87-
map(~ list_rbind(.x, names_to = "outcome_target")) |>
87+
map(~ list_rbind(.x, names_to = "epi_target")) |>
8888
list_rbind() |>
8989
mutate(model = "Unadjusted")
9090

9191
random_effects_joint <- map_df(m.fits_joint,
9292
extract_ranef,
93-
.id = "outcome_target") |>
93+
.id = "epi_target") |>
9494
mutate(model = "Adjusted")
9595

9696
random_effects <- random_effects_joint |>

0 commit comments

Comments
 (0)