Comments (2)
New Corrections to implement:
the big blue tit outliers were still present after the exclusions of highly collinear data, so this led to me to investigate why. It turns out that (a) they were not on the list to exclude because (b) they used conflicting language to describe one of the relevant variables which (apparently) caused me to code two variables incorrectly.
So, here are the two additional rows that should be excluded.
R_3rIdpCqsQtsmgqT Adelong-1-1-1 1 1 1
R_3rIdpCqsQtsmgqT Adelong-2-2-1 2 2 1
Also, we should correct the wrong coding so that, in the Sorensen's analysis, the correct comparisons are made. That correction would be (for these above two rows) the following:
rear_nest_CS
should be'NA'
for both rowsd14_rear_nest_brood_size
should'd14_rear_nest_brood_size'
for both rows.
- Update create_internal_pkg_data.R
- Ensure variables are recoded (locate file used in Sorensen's index calcs, see _targets.R)
from manyecoevo.
Reprex
(posting for record / transparency)
library(ManyEcoEvo)
library(tidyverse)
library(ggplot2)
library(ggforestplot)
library(NatParksPalettes)
library(metafor)
#> Loading required package: Matrix
#>
#> Attaching package: 'Matrix'
#> The following objects are masked from 'package:tidyr':
#>
#> expand, pack, unpack
#> Loading required package: metadat
#> Loading required package: numDeriv
#>
#> Loading the 'metafor' package (version 4.6-0). For an
#> introduction to the package please type: help(metafor)
plot_forest <- function(data, intercept = TRUE, MA_mean = TRUE){
if (MA_mean == FALSE){
data <- filter(data, Parameter != "overall")
}
p <- ggplot(data, aes(y = estimate,
x = term,
ymin = conf.low,
ymax = conf.high,
shape = parameter_type,
colour = parameter_type)) +
geom_pointrange(fatten = 2) +
ggforestplot::theme_forest() +
theme(axis.line = element_line(linewidth = 0.10, colour = "black"),
axis.line.y = element_blank(),
text = element_text(family = "Helvetica")#,
# axis.text.y = element_blank()
) +
guides(shape = guide_legend(title = NULL),
colour = guide_legend(title = NULL)) +
coord_flip() +
ylab(bquote(Standardised~Effect~Size~Z[r])) +
xlab(element_blank()) +
# scale_y_continuous(breaks = c(-4,-3,-2,-1,0,1),
# minor_breaks = seq(from = -4.5, to = 1.5, by = 0.5)) +
NatParksPalettes::scale_color_natparks_d("Glacier")
if(intercept == TRUE){
p <- p + geom_hline(yintercept = 0)
}
if(MA_mean == TRUE){
p <- p + geom_hline(aes(yintercept = meta_analytic_mean),
data = data,
colour = "#01353D",
linetype = "dashed")
}
return(p)
}
filter_params <- rlang::exprs(exclusion_set == "complete",
publishable_subset == "All",
expertise_subset == "All",
# collinearity_subset == "All",
model_name == "MA_mod",
dataset == "blue tit")
summary_output_params <- rlang::exprs(tidy_mod_summary, MA_fit_stats, mod_fit_stats)
map2(.x = list(ManyEcoEvo_viz %>% filter(!!!filter_params)),
.y = summary_output_params,
.f = ~ select(.x, collinearity_subset, all_of(.y)) %>% unnest(.y) %>% knitr::kable(format = "pipe"))
[[1]]
collinearity_subset | term | type | estimate | std.error | statistic | p.value | conf.low | conf.high |
---|---|---|---|---|---|---|---|---|
All | overall | summary | -0.3512059 | 0.0318587 | -11.02388 | 0 | -0.4136477 | -0.2887640 |
collinearity_removed | overall | summary | -0.3505434 | 0.0331427 | -10.57678 | 0 | -0.4155019 | -0.2855848 |
[[2]]
collinearity_subset | sigma2_1 | sigma2_2 | I2_Total | I2_TeamIdentifier | I2_TeamIdentifier/study_id |
---|---|---|---|---|---|
All | 0.0315043 | 0.0522588 | 97.60961 | 36.71212 | 60.89749 |
collinearity_removed | 0.0283110 | 0.0561354 | 97.64318 | 32.73525 | 64.90793 |
[[3]]
collinearity_subset | AIC | BIC | TAU2 | CochransQ | p_CochransQ | df_error | Omnibus | p_Omnibus |
---|---|---|---|---|---|---|---|---|
All | 43.48352 | 52.08612 | 0 | 7441.531 | 0 | 130 | 121.5258 | 0 |
collinearity_removed | 43.00683 | 51.31889 | 0 | 7160.488 | 0 | 118 | 111.8683 | 0 |
ManyEcoEvo_viz %>% filter(!!!filter_params) %>%
mutate(plot_data = map(model,
.f = ~ broom::tidy(.x,
conf.int = TRUE,
include_studies = TRUE)%>%
dplyr::mutate(point_shape =
ifelse(stringr::str_detect(term, "overall"),
"diamond",
"circle"),
Parameter =
forcats::fct_reorder(term,
estimate) %>%
forcats::fct_reorder(.,
point_shape,
.desc = TRUE))
),
meta_analytic_mean = map_dbl(plot_data,
~ filter(.x, Parameter == "overall") %>%
pull(estimate))) %>%
group_by(collinearity_subset) %>%
group_split() %>%
map( ~ select(.x, plot_data, meta_analytic_mean) %>%
unnest(cols = c("plot_data")) %>%
mutate(parameter_type = case_when(str_detect(Parameter, "overall") ~ "mean",
TRUE ~ "study")) %>%
arrange(desc(type)) %>%
mutate(type = forcats::as_factor(type)) %>%
group_by(type) %>%
arrange(desc(estimate),.by_group = TRUE) %>%
mutate(term = forcats::as_factor(term),
point_shape = case_when(str_detect(type, "summary") ~ "mean",
TRUE ~ "study")) %>%
plot_forest(intercept = TRUE, MA_mean = TRUE) +
theme(axis.text.x = element_text(size = 15),
axis.title.x = element_text(size = 15),
axis.text.y = element_blank()
))
Created on 2024-06-14 with reprex v2.1.0
from manyecoevo.
Related Issues (20)
- Note to self displaying on website
- Note to self displaying in website -2
- Note to self displaying in website -3
- (also needs to be renamed) showing on website
- Bug fixes for Manuscript submission HOT 2
- Reduce package data size
- `filter_args` argument for `meta_analyse_datasets()` not behaving correctly in `yi` pipeline HOT 2
- pkgdown vignette error
- don't subset rm outliers on partial exclusion-set, subset on complete HOT 1
- Use gittargets for tracking targets outputs
- revert back to retaining `NULL` instead of coalescing empty list-col elements into nested NAs
- Add `broom::glance()` back into `make_viz()` to get number of observations
- Ensure outlier removal is also run on `exclusion_set == "partial"`
- exclude analysis from euc yi meta-analysis
- ensure extreme SE values excluded prior to meta-analysis of logged yi vals HOT 1
- `mixed_model` still present as predictor in blue tit multivariate models WHY HOT 2
- Ensure `back_transformation` / `augmented_data` not removed in processing pipeline
- duplicated back transformed and Z-transformed values introduced after grouping rm in pipeline HOT 1
- Extreme precision introduced into yi plots after fixing standardisation HOT 2
- Check random effects structure in deviation on peer-ratings models HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from manyecoevo.