Skip to content

Commit

Permalink
#42 rm functions from ManyAnalysts after egouldo/ManyEcoEvo#29
Browse files Browse the repository at this point in the history
  • Loading branch information
egouldo committed Jul 29, 2024
1 parent 91ca56a commit a968e27
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 36 deletions.
16 changes: 4 additions & 12 deletions index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -2919,17 +2919,6 @@ plot_forest_2 <- function(data, intercept = TRUE, MA_mean = TRUE, y_zoom = numer
print(p)
}
fit_MA_mv <- function(effects_analysis, Z_colname, VZ_colname, estimate_type){
Zr <- effects_analysis %>% pull({{Z_colname}})
VZr <- effects_analysis %>% pull({{VZ_colname}})
mod <- ManyEcoEvo::fit_metafor_mv(estimate = Zr,
variance = VZr,
estimate_type = estimate_type,
data = effects_analysis)
return(mod)
}
back_transformed_predictions <-
ManyEcoEvo_yi %>%
dplyr::mutate(data =
Expand Down Expand Up @@ -2967,7 +2956,10 @@ raw_mod_data_logged <-
mod_data_logged <- raw_mod_data_logged %>%
mutate(MA_mod =
map(data,
~fit_MA_mv(.x, mean_log, std.error_log, "yi")))
~ ManyEcoEvo::fit_MA_mv(effects_analysis = .x,
Z_colname = mean_log,
VZ_colname = std.error_log,
estimate_type = "yi")))
plot_data_logged <- mod_data_logged %>%
Expand Down
17 changes: 5 additions & 12 deletions supp_mat/SM2_EffectSizeAnalysis.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -717,17 +717,6 @@ plot_forest_2 <- function(data, intercept = TRUE, MA_mean = TRUE, y_zoom = numer
print(p)
}
# TODO put into R/ and build into package to call!
fit_MA_mv <- function(effects_analysis, Z_colname, VZ_colname, estimate_type){
Zr <- effects_analysis %>% pull({{Z_colname}})
VZr <- effects_analysis %>% pull({{VZ_colname}})
mod <- ManyEcoEvo::fit_metafor_mv(estimate = Zr,
variance = VZr,
estimate_type = estimate_type,
data = effects_analysis)
return(mod)
}
back_transformed_predictions <-
ManyEcoEvo_yi %>%
dplyr::mutate(data =
Expand Down Expand Up @@ -765,7 +754,11 @@ raw_mod_data_logged <-
mod_data_logged <- raw_mod_data_logged %>%
mutate(MA_mod =
map(data,
~fit_MA_mv(.x, mean_log, std.error_log, "yi")))
~ ManyEcoEvo::fit_MA_mv(effects_analysis = .x,
Z_colname = mean_log,
VZ_colname = std.error_log,
estimate_type = "yi"))
)
plot_data_logged <- mod_data_logged %>%
Expand Down
13 changes: 1 addition & 12 deletions supp_mat/SM3_ExplainingDeviation.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,6 @@ gt_fmt_yi <- function(gt_tbl, columns, ...) {


```{r define-fns, eval = TRUE}
#TODO turn into own function and pull out of nested targets function and rm here
fit_MA_mv <- function(effects_analysis, Z_colname, VZ_colname, estimate_type){
Zr <- effects_analysis %>% pull({{Z_colname}})
VZr <- effects_analysis %>% pull({{VZ_colname}})
mod <- ManyEcoEvo::fit_metafor_mv(estimate = Zr,
variance = VZr,
estimate_type = estimate_type,
data = effects_analysis)
return(mod)
}
plot_forest <- function(data, intercept = TRUE, MA_mean = TRUE){
if(MA_mean == FALSE){
data <- filter(data, study_id != "overall")
Expand Down Expand Up @@ -398,7 +387,7 @@ raw_mod_data_logged <-
mod_data_logged <- raw_mod_data_logged %>%
mutate(MA_mod =
map(data,
~fit_MA_mv(.x, mean_log, std.error_log, "yi")))
~ ManyEcoEvo::fit_MA_mv(.x, mean_log, std.error_log, "yi")))
deviation_models_yi_euc <-
raw_mod_data_logged %>%
Expand Down

1 comment on commit a968e27

@egouldo
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#42

Please sign in to comment.