Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explain yi exclusions due to missing param data for constructed variables #61

Closed
egouldo opened this issue Aug 5, 2024 · 0 comments · Fixed by #82
Closed

Explain yi exclusions due to missing param data for constructed variables #61

egouldo opened this issue Aug 5, 2024 · 0 comments · Fixed by #82

Comments

@egouldo
Copy link
Owner

egouldo commented Aug 5, 2024

Insert explanation about yi exclusions due to missing param data for constructed variables. See egouldo/ManyEcoEvo#80 for details.

library(ManyEcoEvo)
library(dplyr)
library(purrr)
library(stringr)
library(tidyr)
library(tibble)

# Constructed Variables Included in the ManyAnalysts meta-analysis
ManyEcoEvo_constructed_vars <-
  tribble(~response_variable_name,
          "euc_sdlgs_all",
          "euc_sdlgs>50cm",
          "euc_sdlgs0_2m",
          "small*0.25+medium*1.25+large*2.5",
          "euc_sdlgs50cm_2m",
          "average.proportion.of.plots.containing.at.least.one.euc.seedling.of.any.size",
          "day_14_weight/(day_14_tarsus_length^2)",
          "day_14_weight/day_14_tarsus_length",
          "day_14_weight*day_14_tarsus_length"
  )

# Analyst Constructed Variables
all_constructed_vars <- 
  ManyEcoEvo %>% 
    pull(data, dataset) %>% 
    list_rbind(names_to = "dataset") %>% 
    filter(str_detect(response_variable_type, "constructed")) %>% 
    distinct(response_variable_name) %>% 
    drop_na() %>% 
    arrange()

by <- join_by(response_variable_name)

all_constructed_vars %>% 
  semi_join(ManyEcoEvo_constructed_vars, by) %>% 
  mutate(included_in_yi = TRUE) %>% 
  bind_rows(
    {
      all_constructed_vars %>% 
        anti_join(ManyEcoEvo_constructed_vars, by) %>% 
        mutate(included_in_yi = FALSE)
    }
  ) %>% 
  knitr::kable(col.names = c("Constructed Variable", 
                             "Included in $y_i$ meta-analysis?"), 
               format = "markdown")
@egouldo egouldo added this to the Respond Peer Review Comments milestone Aug 5, 2024
@egouldo egouldo self-assigned this Aug 5, 2024
egouldo added a commit that referenced this issue Aug 5, 2024
egouldo added a commit that referenced this issue Aug 5, 2024
@egouldo egouldo closed this as completed Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant