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

extra numbers - deletion needed #46

Closed
parkerth opened this issue Jul 29, 2024 · 4 comments · Fixed by #82
Closed

extra numbers - deletion needed #46

parkerth opened this issue Jul 29, 2024 · 4 comments · Fixed by #82
Assignees
Labels
bug an unexpected problem or unintended behavior

Comments

@parkerth
Copy link
Collaborator

For the *Eucalyptus* dataset, the meta-analytic mean shifted from `r filter(effectsparams, dataset == "eucalyptus", publishable_subset == "All") %>% round_pluck("estimate")` to `r filter(effectsparams, dataset == "eucalyptus", publishable_subset == "data_flawed") %>% round_pluck("estimate")` when effects from analyses rated as unpublishable were removed, and to `r filter(effectsparams, dataset == "eucalyptus", publishable_subset == "data_flawed_major") %>% round_pluck("estimate")` when effects from analyses rated, at least once, as unpublishable or requiring major revisions were removed.

In the render, this currently reads as:

"For the Eucalyptus dataset, the meta-analytic mean shifted from -0.09, -0.17, -0.03 to -0.02 when effects from analyses rated as unpublishable were removed, and to -0.04 when effects from analyses rated, at least once, as unpublishable or requiring major revisions were removed."

There are too many numbers in that first list of numbers.

@egouldo egouldo added the bug an unexpected problem or unintended behavior label Jul 31, 2024
@egouldo egouldo added this to the Respond Peer Review Comments milestone Jul 31, 2024
@hannahsfraser
Copy link
Collaborator

I think I need the packages to run to fix this. I suspect we just need to add an extra filter clause in because several results are being called by the current one... but I need to see the object it's pulling from to know how to do that

@egouldo
Copy link
Owner

egouldo commented Aug 10, 2024

Thanks @hannahsfraser The relevant chunk is:

ManyAnalysts/index.qmd

Lines 3443 to 3510 in 31412e0

#| label: tbl-effects-params
#| tbl-cap: 'Estimated mean value of the standardised correlation coefficient, $Z_r$, along with its standard error and 95$\\%$confidence intervals. We re-computed the meta-analysis for different post-hoc subsets of the data: All eligible effects, removal of effects from blue tit analyses that contained a pair of highly collinear predictor variables, removal of effects from analysis teams that received at least one peer rating of "deeply flawed and unpublishable", removal of any effects from analysis teams that received at least one peer rating of either "deeply flawed and unpublishable" or "publishable with major revisions", inclusion of only effects from analysis teams that included at least one member who rated themselves as "highly proficient" or "expert" at conducting statistical analyses in their research area.'
#| echo: false
effectsparams <- ManyEcoEvo_viz %>%
dplyr::filter(estimate_type == "Zr",
model_name == "MA_mod",
exclusion_set == "complete") %>%
bind_rows(ManyEcoEvo_viz %>%
dplyr::filter(exclusion_set == "complete-rm_outliers",
estimate_type == "Zr",
model_name == "MA_mod",
publishable_subset == "All")) %>%
hoist(tidy_mod_summary) %>%
unnest(tidy_mod_summary)
effectsparams %>%
select(dataset,
exclusion_set,
publishable_subset,
expertise_subset,
collinearity_subset,
estimate,
std.error,
statistic,
p.value,
starts_with("conf")) %>%
mutate(publishable_subset =
case_when(publishable_subset == "All" & expertise_subset == "All" ~
"All analyses",
publishable_subset == "data_flawed" & expertise_subset == "All" ~
"Analyses receiving at least one 'Unpublishable' rating removed",
publishable_subset == "data_flawed_major" & expertise_subset == "All" ~
"Analyses receiving at least one 'Unpublishable' and or 'Major Revisions' rating removed",
expertise_subset == "expert" ~ "Analyses from teams with highly proficient or expert data analysts",
collinearity_subset == "collinearity_removed" ~ "Blue tit analyses containing highly collinear predictors removed",
TRUE ~ ""),
exclusion_set =
case_when(exclusion_set == "complete" ~ "",
TRUE ~ ", outliers removed"),
dataset = case_when(str_detect(dataset, "euc") ~ "Eucalyptus",
TRUE ~ dataset),
collinearity_subset = dplyr::na_if(collinearity_subset, "All")) %>%
select(-expertise_subset) %>%
unite("data_subset", publishable_subset, exclusion_set, sep = "", remove = TRUE) %>%
group_by(data_subset) %>%
arrange(data_subset, dataset) %>%
gt::gt() %>%
gt::opt_stylize(style = 6, color = "gray") %>%
gt::fmt(columns = "p.value",
fns = function(x) gtsummary::style_pvalue(x)) %>%
gt::fmt_number(columns = c(-p.value, -dataset)) %>%
gt::sub_missing(columns = "collinearity_subset", rows = everything(), "") %>%
gt::fmt("collinearity_subset", fns = function(x) str_replace(x, "_", " ") %>%
str_c(", ", .)) %>%
gt::cols_label(dataset = "Dataset",
estimate = "$$\\hat\\mu$$",
std.error = gt::md("$$\\text{SE}[\\hat\\mu]$$"),
conf.low = gt::md("95\\%CI"),
p.value = "p-value") %>%
gt::cols_merge(columns = c(dataset, collinearity_subset),
hide_columns =c(collinearity_subset)) %>%
gt::cols_merge(columns = starts_with("conf"),
pattern = "[{1},{2}]") %>%
gt::cols_move(columns = conf.low, after = std.error) %>%
gt::tab_style(locations = cells_body(rows = str_detect(dataset, "Eucalyptus"),
columns = dataset),
style = cell_text(style = "italic")) %>%
gt::as_raw_html()

on branch 42-mv-fns-2-pkg.

I think if you:

  1. check out 42-mv-fns-2-pkg locally
  2. pull / push to sync
  3. run renv::activate()/renv::restore() to install all the relavant libraries in the renv
  4. install latest ManyEcoEvo:: package with: renv::install("egouldo/ManyEcoEvo@v2.3.0")

you should be able to get it to render.

Alternatively, you can download and load the latest ManYEcoEvo, mess around with the chunk code interactively, and post a solution here for me to upgrade, if that's easier!

And if you can't get it going with either of those, I'll come back to this later.

@hannahsfraser
Copy link
Collaborator

I'm sorry, Elliot. I cant seem to get the damn thing to work. renv::restore keeps failing so I cant seem to get all the packages I need. I'm going to have to put this back on your plate.

@hannahsfraser hannahsfraser removed their assignment Aug 27, 2024
@egouldo
Copy link
Owner

egouldo commented Aug 27, 2024 via email

@egouldo egouldo closed this as completed Sep 4, 2024
egouldo added a commit that referenced this issue Sep 4, 2024
Relates to #42 need to filter out expertise subsets and collinearity subsets
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants