articles <- meta_v1 %>%
count(ID)
In all effect sizes group 1 is cannibalism group and group 2 is not cannibalism group
#data that has mean, sd, n of cannibalized and uncannibalized groups group 1 = cannibalized, group 2 = not cannibalized
datw_nosd_n <- meta_v1 %>%
select(ID, year, genus, spcs, es_ID, female_ID, male_ID, treatment_ID, ate_mean, ate_sd, ate_n, no_mean, no_sd, no_n, cannibal, mate_status, behaviour, breakdown, response, general_response, exprt, habitat, data, occur, adaptive,aggressive, parental, choice) %>%
filter(!is.na(ate_sd)) %>%
filter(!is.na(ate_n))
es1 <- escalc(n1i=ate_n, n2i=no_n, m1i=ate_mean, m2i=no_mean, sd1i=ate_sd, sd2i=no_sd, data=datw_nosd_n, measure="SMD")
es1_mod <- es1 %>%
select(ID, year, es_ID,female_ID, male_ID, treatment_ID, genus, spcs, cannibal, mate_status, behaviour, breakdown, response,general_response, exprt, habitat, data, occur, yi, vi, adaptive, aggressive, parental, choice) %>%
mutate(es_type=sprintf("SMD_known_sample_size%02d", 1:length(yi)))
#data that has mean, sd, n estimated group 1 = cannibalized, group 2= not cannibalized
datw_nosd_estn <- meta_v1 %>%
select(ID, year,es_ID, female_ID, male_ID, treatment_ID, genus, spcs, ate_mean, ate_sd, est_ate_n, no_mean, no_sd, est_no_n, cannibal, mate_status, behaviour, breakdown, response,general_response, exprt, habitat, data, occur, adaptive, aggressive, parental, choice) %>%
filter(!is.na(ate_sd)) %>%
filter(!is.na(est_ate_n))
es2 <- escalc(n1i=est_ate_n, n2i=est_no_n, m1i=ate_mean, m2i=no_mean, sd1i=ate_sd, sd2i=no_sd, data=datw_nosd_estn, measure="SMD")
es2_mod <- es2 %>%
select(ID, genus,year,es_ID, female_ID, male_ID, treatment_ID, spcs, cannibal, mate_status, behaviour, breakdown, response,general_response, exprt, habitat, data, occur, yi, vi, adaptive, aggressive, parental, choice) %>%
mutate(es_type=sprintf("SMD_estimated_sample_size%02d", 1:length(yi)))
#full es data
es <- rbind(es1_mod, es2_mod)
str(es)
## Classes 'escalc' and 'data.frame': 525 obs. of 25 variables:
## $ ID : chr "ft007" "ft007" "ft007" "ft007" ...
## $ year : int 2016 2016 2016 2016 2016 2016 2016 2016 2016 2016 ...
## $ es_ID : chr "es_20" "es_21" "es_22" "es_23" ...
## $ female_ID : chr "f_8" "f_9" "f_8" "f_9" ...
## $ male_ID : chr "m_8" "m_9" "m_8" "m_9" ...
## $ treatment_ID : chr "trt_20" "trt_21" "trt_22" "trt_23" ...
## $ genus : chr "Pisaurina" "Pisaurina" "Pisaurina" "Pisaurina" ...
## $ spcs : chr "Pisaurina mira" "Pisaurina mira" "Pisaurina mira" "Pisaurina mira" ...
## $ cannibal : chr "female" "female" "female" "female" ...
## $ mate_status : chr "unknown" "unknown" "unknown" "unknown" ...
## $ behaviour : chr "cannibal" "cannibal" "cannibal" "cannibal" ...
## $ breakdown : chr NA NA NA NA ...
## $ response : chr "leg:body" "leg:body" "victim mass" "victim mass" ...
## $ general_response: chr "victim size" "victim size" "victim size" "victim size" ...
## $ exprt : chr "lab" "lab" "lab" "lab" ...
## $ habitat : chr "field" "field" "field" "field" ...
## $ data : chr "raw" "raw" "raw" "raw" ...
## $ occur : chr "post" "pre" "post" "pre" ...
## $ yi : num -0.7766 0.3694 -0.5577 -0.0674 -0.0992 ...
## ..- attr(*, "ni")= num [1:50] 20 31 20 31 20 31 20 31 20 20 ...
## ..- attr(*, "measure")= chr "SMD"
## $ vi : num 0.235 0.187 0.228 0.185 0.22 ...
## $ adaptive : chr "Y" "Y" "Y" "Y" ...
## $ aggressive : chr "N" "N" "N" "N" ...
## $ parental : chr "N" "N" "N" "N" ...
## $ choice : chr "Y" "Y" "Y" "Y" ...
## $ es_type : chr "SMD_known_sample_size01" "SMD_known_sample_size02" "SMD_known_sample_size03" "SMD_known_sample_size04" ...
## - attr(*, "yi.names")= chr "yi"
## - attr(*, "vi.names")= chr "vi"
## - attr(*, "digits")= Named num [1:9] 4 4 4 4 4 4 4 4 4
## ..- attr(*, "names")= chr [1:9] "est" "se" "test" "pval" ...
Reasons:
* ft097; ft145; - no uncannibalized data for this response (emailed authors)
Used this program: https://github.com/DeepanshuSharma-BNB/Deep_Meta_Tool
median <- read.csv("datw_median_sd.csv")
datw_median <- median %>%
select(ID,year,es_ID,female_ID, male_ID, treatment_ID, genus, spcs, ate_med, ate_low, ate_high, ate_n, no_med, no_low, no_high, no_n, cannibal, mate_status, behaviour, breakdown, response,general_response, exprt, habitat, data, occur) %>%
filter(!is.na(ate_med))
es3 <- escalc(n1i=ate_n, n2i=no_n, m1i=ate_mean, m2i=no_mean, sd1i=ate_sd, sd2i=no_sd, data=median, measure="SMD")
es3_mod <- es3 %>%
select(ID,year,es_ID,female_ID, male_ID, treatment_ID, genus, spcs, cannibal, mate_status, behaviour, breakdown, response,general_response, exprt, habitat, data, occur, yi, vi, adaptive, aggressive, parental, choice) %>%
mutate(es_type=sprintf("median_SMD%02d", 1:length(yi)))
#full model all 3 es's
es_full2 <- rbind(es3_mod, es)
str(es_full2)
## Classes 'escalc' and 'data.frame': 590 obs. of 25 variables:
## $ ID : chr "ft003" "ft003" "ft003" "ft003" ...
## $ year : int 2011 2011 2011 2011 2011 2011 2011 2011 2011 2011 ...
## $ es_ID : chr "es_6" "es_7" "es_8" "es_9" ...
## $ female_ID : chr "f_2" "f_3" "f_4" "f_2" ...
## $ male_ID : chr "m_2" "m_3" "m_4" "m_2" ...
## $ treatment_ID : chr "trt_6" "trt_7" "trt_8" "trt_9" ...
## $ genus : chr "Allocosa" "Allocosa" "Allocosa" "Allocosa" ...
## $ spcs : chr "Allocosa brasiliensis" "Allocosa brasiliensis" "Allocosa brasiliensis" "Allocosa brasiliensis" ...
## $ cannibal : chr "male" "male" "male" "male" ...
## $ mate_status : chr "unknown" "unknown" "unknown" "unknown" ...
## $ behaviour : chr "attack" "attack" "attack" "attack" ...
## $ breakdown : chr "mated female" "virgin & mated females" "virgin female" "mated female" ...
## $ response : chr "cannibal condition" "cannibal condition" "cannibal condition" "cannibal mass" ...
## $ general_response: chr "cannibal condition" "cannibal condition" "cannibal condition" "cannibal size" ...
## $ exprt : chr "lab" "lab" "lab" "lab" ...
## $ habitat : chr "field" "field" "field" "field" ...
## $ data : chr "table" "table" "table" "table" ...
## $ occur : chr "pre" "pre" "pre" "pre" ...
## $ yi : num -0.5203 -0.2873 -0.0879 0.0564 -1.1463 ...
## ..- attr(*, "ni")= num [1:75] 19 38 19 38 19 19 19 19 22 22 ...
## ..- attr(*, "measure")= chr "SMD"
## $ vi : num 0.233 0.137 0.396 0.226 0.153 ...
## $ adaptive : chr "Y" "Y" "Y" "Y" ...
## $ aggressive : chr "Y" "Y" "Y" "Y" ...
## $ parental : chr NA NA NA NA ...
## $ choice : chr NA NA NA NA ...
## $ es_type : chr "median_SMD01" "median_SMD02" "median_SMD03" "median_SMD04" ...
## - attr(*, "yi.names")= chr "yi"
## - attr(*, "vi.names")= chr "vi"
## - attr(*, "digits")= Named num [1:9] 4 4 4 4 4 4 4 4 4
## ..- attr(*, "names")= chr [1:9] "est" "se" "test" "pval" ...
Reasons:
* ft055;ft079 - missing quartile and/or uncannibalized
* ft104 - missing quartiles
#data with regression coefficients (standardized)
datw_coeff <- meta_v1 %>%
select(ID,year,es_ID, female_ID, male_ID, treatment_ID,genus, spcs, coeff, ate_sd, est_ate_n, est_no_n, cannibal, mate_status, behaviour, breakdown, response,general_response, exprt, habitat, data, occur, adaptive,aggressive, parental, choice) %>%
filter(!is.na(coeff))
es_coeff <- as.data.frame(esc_beta(beta=datw_coeff$coeff, sdy=datw_coeff$ate_sd, grp1n=datw_coeff$est_ate_n, grp2n=datw_coeff$est_no_n, es.type="g"))
es_coeff_dat <- cbind(es_coeff, datw_coeff)
es1_coeff <- es_coeff_dat %>%
select(ID,year,es_ID,female_ID, male_ID, treatment_ID, genus, spcs, cannibal, mate_status, behaviour, breakdown, response,general_response, exprt, habitat, data, occur, es, var, adaptive, aggressive, parental, choice) %>%
mutate(es_type=sprintf("coeff_hedge_g%02d", 1:length(es)))
#data with correlation coefficients
datw_corr <- meta_v1 %>%
select(ID,year, es_ID,female_ID, male_ID, treatment_ID, genus, spcs, corr, indv_n, cannibal, mate_status, behaviour, breakdown, response,general_response, exprt, habitat, data, occur, adaptive,aggressive, parental, choice) %>%
filter(!is.na(corr)) %>%
filter(!is.na(indv_n))
corr_dat <- as.data.frame(esc_rpb(r=datw_corr$corr, totaln=datw_corr$indv_n, es.type="g"))
corr_comb <- cbind(corr_dat, datw_corr)
es_corr <- corr_comb %>%
select(ID,year,es_ID,female_ID, male_ID, treatment_ID, genus, spcs, cannibal, mate_status, behaviour, breakdown, response,general_response, exprt, habitat, data, occur, es, var, adaptive, aggressive, parental, choice) %>%
mutate(es_type=sprintf("corr_hedge_g%02d", 1:length(es)))
#corr and coeff full model
es_corrcoeff <- rbind(es_corr, es1_coeff)
#chaning variables to match other data frames
names(es_corrcoeff)[19] <- paste("yi")
names(es_corrcoeff)[20] <- paste("vi")
str(es_corrcoeff)
## 'data.frame': 15 obs. of 25 variables:
## $ ID : chr "ft072" "ft015" "ft015" "ft015" ...
## $ year : int 2016 2015 2015 2015 2015 2018 2018 2016 2016 2016 ...
## $ es_ID : chr "es_416" "es_93" "es_94" "es_95" ...
## $ female_ID : chr "f_130" "f_19" "f_19" "f_19" ...
## $ male_ID : chr "m_150" "m_21" "m_21" "m_21" ...
## $ treatment_ID : chr "trt_366" "trt_83" "trt_84" "trt_85" ...
## $ genus : chr "Dolomedes" "Alpaida" "Alpaida" "Alpaida" ...
## $ spcs : chr "Dolomedes fimbriatus" "Alpaida veniliae" "Alpaida veniliae" "Alpaida veniliae" ...
## $ cannibal : chr "female" "female" "female" "female" ...
## $ mate_status : chr "unknown" "virgin" "virgin" "virgin" ...
## $ behaviour : chr "cannibal" "cannibal" "cannibal" "cannibal" ...
## $ breakdown : chr NA NA NA NA ...
## $ response : chr "SSD" "copulation duration" "courtship duration" "m:f" ...
## $ general_response: chr "SSD" "copulation duration" "courtship duration" "SSD" ...
## $ exprt : chr "lab" "lab" "lab" "lab" ...
## $ habitat : chr "field" "lab" "lab" "lab" ...
## $ data : chr "table" "table" "table" "table" ...
## $ occur : chr "pre" "post" "post" "post" ...
## $ yi : num 0.51714 0.40173 -0.00394 -1.99186 -2.34454 ...
## $ vi : num 0.06 0.0397 0.0389 0.0585 0.066 ...
## $ adaptive : chr "Y" "N" "N" "Y" ...
## $ aggressive : chr "Y" "N" "N" "Y" ...
## $ parental : chr "N" "N" "N" "N" ...
## $ choice : chr "N" "Y" "Y" "N" ...
## $ es_type : chr "corr_hedge_g01" "coeff_hedge_g01" "coeff_hedge_g02" "coeff_hedge_g03" ...
This ES takes into account how many individuals started in the treatment group (cannibalized vs uncannibalized) and how many underwent the treatment
#using known sample sizes
dat_rr <- meta_v1 %>%
select(ID, year,es_ID,female_ID, male_ID, treatment_ID,genus, spcs, ate_n, start_ate_n, no_n, start_no_n, cannibal, mate_status, behaviour, breakdown, response,general_response, exprt, habitat, data, occur, adaptive, aggressive, parental, choice) %>%
filter(!is.na(start_ate_n)) %>%
filter(!is.na(ate_n))
dat_rr_total_n <- dat_rr %>%
mutate(total_n=(start_no_n + start_ate_n))
es_rr <- escalc(measure="OR", ai=ate_n, bi=start_ate_n, ci=no_n, di=start_no_n, data=dat_rr)
#converting OR to cohens D and cohens variance
#this is done using formulas Hedges g = J x d; Vg=J^2 x Var d
#Where J=1-3/4df-1
es_rr_to_g <- es_rr %>%
mutate(cohend=(yi*(sqrt(3)/pi)), vard=(vi*(sqrt(3)/(pi^2)))) %>%
mutate(hedgeg=(1-(3/(4*(start_ate_n+start_no_n-2))))*cohend, seg=sqrt(((1-(3/(4*(start_ate_n+start_no_n-2))))^2)*vard)) %>%
select(ID, year,es_ID,female_ID, male_ID, treatment_ID,genus, spcs, cannibal, mate_status, behaviour, breakdown, response,general_response, exprt, habitat, data, occur, hedgeg, seg, adaptive, aggressive, parental, choice) %>%
rename(yi = hedgeg, vi = seg)
es_rr_to_g['es_type'] <- "OR_hedge_g"
es_or_mod <- es_rr_to_g %>%
select(ID,year, es_ID,female_ID, male_ID, treatment_ID, genus, spcs, cannibal, mate_status, behaviour, breakdown, response,general_response, exprt, habitat, data, occur, yi, vi, adaptive, aggressive, parental, choice) %>%
mutate(es_type=sprintf("OR_hedge_g%02d", 1:length(yi)))
#using estimated sample sizes
dat_rr_n <- meta_v1 %>%
select(ID,year,es_ID,female_ID, male_ID, treatment_ID, genus, spcs, est_ate_n, start_ate_n, est_no_n, start_no_n, cannibal, mate_status, behaviour, breakdown, response,general_response, exprt, habitat, data, occur, adaptive, aggressive, parental, choice) %>%
filter(!is.na(start_ate_n)) %>%
filter(!is.na(est_ate_n))
es_rr_n <- escalc(measure="OR", ai=est_ate_n, bi=start_ate_n, ci=est_no_n, di=start_no_n, data=dat_rr_n)
es_rr_to_g_est_n <- es_rr_n %>%
mutate(cohend=(yi*(sqrt(3)/pi)), vard=(vi*(sqrt(3)/(pi^2)))) %>%
mutate(hedgeg=(1-(3/(4*(start_ate_n+start_no_n-2))))*cohend, seg=sqrt(((1-(3/(4*(start_ate_n+start_no_n-2))))^2)*vard)) %>%
select(ID, year,es_ID,female_ID, male_ID, treatment_ID,genus, spcs, cannibal, mate_status, behaviour, breakdown, response,general_response, exprt, habitat, data, occur, hedgeg, seg, adaptive, aggressive, parental, choice) %>%
rename(yi = hedgeg, vi = seg) %>%
mutate(es_type=sprintf("OR_hedge_g_est_n%02d", 1:length(yi)))
es_or_full <- rbind(es_or_mod, es_rr_to_g_est_n)
str(es_or_full)
## Classes 'escalc' and 'data.frame': 267 obs. of 25 variables:
## $ ID : chr "ft004" "ft004" "ft007" "ft007" ...
## $ year : int 2011 2011 2016 2016 2016 2016 2017 2017 2017 2017 ...
## $ es_ID : chr "es_18" "es_19" "es_41" "es_42" ...
## $ female_ID : chr "f_6" "f_7" "f_8" "f_9" ...
## $ male_ID : chr "m_6" "m_7" "m_8" "m_9" ...
## $ treatment_ID : chr "trt_18" "trt_19" "trt_41" "trt_42" ...
## $ genus : chr "Leucauge" "Leucauge" "Pisaurina" "Pisaurina" ...
## $ spcs : chr "Leucauge argyra" "Leucauge argyra" "Pisaurina mira" "Pisaurina mira" ...
## $ cannibal : chr "female" "female" "female" "female" ...
## $ mate_status : chr "virgin" "mated" "unknown" "unknown" ...
## $ behaviour : chr "cannibal" "cannibal" "cannibal" "cannibal" ...
## $ breakdown : chr NA NA NA NA ...
## $ response : chr NA NA "no silk wrap" "no silk wrap" ...
## $ general_response: chr NA NA "copulation behaviour" "copulation behaviour" ...
## $ exprt : chr "lab" "lab" "lab" "lab" ...
## $ habitat : chr "field" "field" "field" "field" ...
## $ data : chr "text" "text" "raw" "raw" ...
## $ occur : chr "pre" "pre" "post" "pre" ...
## $ yi : num -1.161 0.693 0.373 -0.424 -1.235 ...
## ..- attr(*, "ni")= int [1:230] 30 15 41 48 41 45 52 87 56 91 ...
## ..- attr(*, "measure")= chr "OR"
## $ vi : num 0.46 0.488 0.323 0.263 0.453 ...
## $ adaptive : chr "Y" "Y" "N" "N" ...
## $ aggressive : chr "Y" "Y" "N" "N" ...
## $ parental : chr "N" "N" "N" "N" ...
## $ choice : chr "N" "N" "Y" "Y" ...
## $ es_type : chr "OR_hedge_g01" "OR_hedge_g02" "OR_hedge_g03" "OR_hedge_g04" ...
## - attr(*, "digits")= Named num [1:9] 4 4 4 4 4 4 4 4 4
## ..- attr(*, "names")= chr [1:9] "est" "se" "test" "pval" ...
#with known sample size
dat_anova <- meta_v1 %>%
filter(stat_test == "ANOVA") %>%
select(ID,year,es_ID, female_ID, male_ID, treatment_ID, genus, spcs, ate_n, no_n, stat, cannibal, mate_status, behaviour, breakdown, response,general_response, exprt, habitat, data, occur, adaptive, aggressive, parental, choice) %>%
filter(!is.na(ate_n))
anova_dat <- as.data.frame(esc_f(f=dat_anova$stat, grp1n = dat_anova$ate_n, grp2n=dat_anova$no_n, es.type="g"))
es_aov <- cbind(anova_dat, dat_anova)
es_anova <- es_aov %>%
select(ID,year,es_ID,female_ID, male_ID, treatment_ID, genus, spcs, cannibal, mate_status, behaviour, breakdown, response,general_response, exprt, habitat, data, occur, es, var, adaptive, aggressive, parental, choice) %>%
mutate(es_type=sprintf("anova_hedge_g%02d", 1:length(es)))
#with estimated sample sizes
dat_anova_n <- meta_v1 %>%
filter(stat_test == "ANOVA") %>%
select(ID,year,es_ID, genus,female_ID, male_ID, treatment_ID, spcs, est_ate_n, est_no_n, stat, cannibal, mate_status, behaviour, breakdown, response,general_response, exprt, habitat, data, occur, adaptive, aggressive, parental, choice) %>%
filter(!is.na(est_ate_n))
anova_dat_n <- as.data.frame(esc_f(f=dat_anova_n$stat, grp1n = dat_anova_n$est_ate_n, grp2n=dat_anova_n$est_no_n, es.type="g"))
es_aov_n <- cbind(anova_dat_n, dat_anova_n)
es_anova_n <- es_aov_n %>%
select(ID,year,es_ID,female_ID, male_ID, treatment_ID, genus, spcs, cannibal, mate_status, behaviour, breakdown, response,general_response, exprt, habitat, data, occur, es, var, adaptive, aggressive, parental, choice) %>%
mutate(es_type=sprintf("est_ate_n_anova_hedge_g%02d", 1:length(es)))
#with unknown group sample sizes
dat_anova_tot <- meta_v1 %>%
filter(stat_test == "ANOVA") %>%
select(ID,year,es_ID, female_ID, male_ID, treatment_ID,genus, spcs, mate_n, stat, cannibal, mate_status, behaviour, breakdown, response,general_response, exprt, habitat, data, occur, adaptive, aggressive, parental, choice) %>%
filter(!is.na(mate_n))
anova_dat_tot <- as.data.frame(esc_f(f=dat_anova_n$stat, totaln = dat_anova_tot$mate_n, es.type="g"))
es_aov_tot <- cbind(anova_dat_tot, dat_anova_tot)
es_anova_tot <- es_aov_tot %>%
select(ID, year,es_ID,female_ID, male_ID, treatment_ID,genus, spcs, cannibal, mate_status, behaviour, breakdown, response,general_response, exprt, habitat, data, occur, es, var, adaptive, aggressive, parental, choice) %>%
mutate(es_type=sprintf("est_total_n_anova_hedge_g%02d", 1:length(es)))
#full ANOVA es model
es_full_aov <- rbind(es_anova, es_anova_n)
es_full_anova <- rbind(es_full_aov, es_anova_tot)
#changing variables to match other data frames
names(es_full_anova)[19] <- paste("yi")
names(es_full_anova)[20] <- paste("vi")
str(es_full_anova)
## 'data.frame': 13 obs. of 25 variables:
## $ ID : chr "ft064" "ft064" "ft097" "ft097" ...
## $ year : int 2001 2001 2008 2008 2006 2000 2008 2002 2009 2019 ...
## $ es_ID : chr "es_386" "es_388" "es_532" "es_533" ...
## $ female_ID : chr "f_116" "f_117" "f_181" "f_181" ...
## $ male_ID : chr "m_135" "m_136" "m_205" "m_205" ...
## $ treatment_ID : chr "trt_336" "trt_338" "trt_477" "trt_478" ...
## $ genus : chr "Dolomedes" "Dolomedes" "Lycosa" "Lycosa" ...
## $ spcs : chr "Dolomedes triton" "Dolomedes triton" "Lycosa tarantula" "Lycosa tarantula" ...
## $ cannibal : chr "female" "female" "female" "female" ...
## $ mate_status : chr "virgin" "virgin" "unknown" "unknown" ...
## $ behaviour : chr "cannibal" "cannibal" "cannibal" "cannibal" ...
## $ breakdown : chr "1st clutch" "2nd clutch" NA NA ...
## $ response : chr "offspring survival" "offspring survival" "offspring survival" "spiderling cannibalism" ...
## $ general_response: chr "offspring fitness" "offspring fitness" "offspring fitness" "offspring fitness" ...
## $ exprt : chr "lab" "lab" "field" "field" ...
## $ habitat : chr "field" "field" "field" "field" ...
## $ data : chr "text" "text" "text" "text" ...
## $ occur : chr "pre" "pre" "post" "post" ...
## $ yi : num 0.0462 0.08 0.1355 0.6449 0.1322 ...
## $ vi : num 0.1115 0.1115 0.0626 0.0655 0.1145 ...
## $ adaptive : chr "N" "N" "N" "N" ...
## $ aggressive : chr "N" "N" "N" "N" ...
## $ parental : chr "Y" "Y" "Y" "Y" ...
## $ choice : chr "N" "N" "N" "N" ...
## $ es_type : chr "anova_hedge_g01" "anova_hedge_g02" "anova_hedge_g03" "anova_hedge_g04" ...
error with ft058 because X^2 value is greater than sample size
dat_x2 <- meta_v1 %>%
filter(stat_test == "Chi square") %>%
select(ID,year,es_ID,female_ID, male_ID, treatment_ID, genus, spcs, indv_n, stat, cannibal, mate_status, behaviour, breakdown, response,general_response, exprt, habitat, data, occur, adaptive, aggressive, parental, choice) %>%
filter(!is.na(indv_n))
x2_dat_tot <- as.data.frame(esc_chisq(chisq=dat_x2$stat, totaln=dat_x2$indv_n, es.type="cox.or"))
es_chi <- cbind(x2_dat_tot,dat_x2)
es_chi['es_type'] <- "chisqr_hedge_g"
es_x2 <- es_chi %>%
select(ID,year,es_ID,female_ID, male_ID, treatment_ID, genus, spcs, cannibal, mate_status, behaviour, breakdown, response,general_response, exprt, habitat, data, occur, es, var, adaptive, aggressive, parental, choice) %>%
mutate(es_type=sprintf("chisqr_hedge_g%02d", 1:length(es)))
names(es_x2)[19] <- paste("yi")
names(es_x2)[20] <- paste("vi")
str(es_x2)
## 'data.frame': 73 obs. of 25 variables:
## $ ID : chr "ft001" "ft001" "ft001" "ft001" ...
## $ year : int 2019 2019 2019 2019 2018 2018 2018 2018 2018 2018 ...
## $ es_ID : chr "es_2" "es_3" "es_4" "es_5" ...
## $ female_ID : chr "f_1" "f_1" "f_1" "f_1" ...
## $ male_ID : chr "m_1" "m_1" "m_1" "m_1" ...
## $ treatment_ID : chr "trt_2" "trt_3" "trt_4" "trt_5" ...
## $ genus : chr "Aglaoctenus" "Aglaoctenus" "Aglaoctenus" "Aglaoctenus" ...
## $ spcs : chr "Aglaoctenus lagotis" "Aglaoctenus lagotis" "Aglaoctenus lagotis" "Aglaoctenus lagotis" ...
## $ cannibal : chr "female" "female" "female" "female" ...
## $ mate_status : chr "virgin" "virgin" "virgin" "virgin" ...
## $ behaviour : chr "cannibal" "cannibal" "cannibal" "cannibal" ...
## $ breakdown : chr NA NA NA NA ...
## $ response : chr "palpal insertions" "alternate wavings" "rubbing" "web stretching" ...
## $ general_response: chr "copulation behaviour" "courtship behaviour" "courtship behaviour" "courtship behaviour" ...
## $ exprt : chr "lab" "lab" "lab" "lab" ...
## $ habitat : chr "field" "field" "field" "field" ...
## $ data : chr "text" "text" "text" "text" ...
## $ occur : chr "post" "post" "post" "post" ...
## $ yi : num 1.14 1.39 1.24 1.09 1.66 ...
## $ vi : num 0.9098 0.9174 0.9121 0.9089 0.0996 ...
## $ adaptive : chr "N" "N" "N" "N" ...
## $ aggressive : chr "N" "N" "N" "N" ...
## $ parental : chr "N" "N" "N" "N" ...
## $ choice : chr "Y" "Y" "Y" "Y" ...
## $ es_type : chr "chisqr_hedge_g01" "chisqr_hedge_g02" "chisqr_hedge_g03" "chisqr_hedge_g04" ...
#total sample sizes
dat_t <- meta_v1 %>%
filter(stat_test == "t test") %>%
select(ID,year,es_ID,female_ID, male_ID, treatment_ID, genus, spcs, indv_n, est_no_n, stat, cannibal, mate_status, behaviour, breakdown, response,general_response, exprt, habitat, data, occur, adaptive, aggressive, parental, choice) %>%
filter(is.na(est_no_n))
t_dat <- as.data.frame(esc_t(t=dat_t$stat, totaln=dat_t$indv_n, es.type="g"))
es_t <- cbind(t_dat,dat_t)
es_t0 <- es_t %>%
select(ID,year,es_ID,female_ID, male_ID, treatment_ID, genus, spcs, cannibal, mate_status, behaviour, breakdown, response,general_response, exprt, habitat, data, occur, es, var, adaptive, aggressive, parental, choice) %>%
mutate(es_type=sprintf("ttest_hedge_g%02d", 1:length(es)))
#unknown sample sizes
dat_t_n <- meta_v1 %>%
filter(stat_test == "t test") %>%
select(ID,year,es_ID, female_ID, male_ID, treatment_ID,genus, spcs, est_ate_n, est_no_n, stat, cannibal, mate_status, behaviour, breakdown, response,general_response, exprt, habitat, data, occur, adaptive, aggressive, parental, choice) %>%
filter(!is.na(est_ate_n))
t_dat_n <- as.data.frame(esc_t(t=dat_t_n$stat, grp1n=dat_t_n$est_ate_n, grp2n=dat_t_n$est_no_n, es.type="g"))
es_t_n <- cbind(t_dat_n,dat_t_n)
es_t1 <- es_t_n %>%
select(ID, year,es_ID,female_ID, male_ID, treatment_ID,genus, spcs, cannibal, mate_status, behaviour, breakdown, response,general_response, exprt, habitat, data, occur, es, var, adaptive, aggressive, parental, choice) %>%
mutate(es_type=sprintf("est_ate_n_ttest_hedge_g%02d", 1:length(es)))
es_ttest <- rbind(es_t1,es_t0)
names(es_ttest)[19] <- paste("yi")
names(es_ttest)[20] <- paste("vi")
str(es_ttest)
## 'data.frame': 12 obs. of 25 variables:
## $ ID : chr "ft036" "ft036" "ft137" "ft147" ...
## $ year : int 2000 2000 2012 2009 2016 2005 2005 2005 2005 2005 ...
## $ es_ID : chr "es_226" "es_227" "es_777" "es_879" ...
## $ female_ID : chr "f_58" "f_58" "f_281" "f_313" ...
## $ male_ID : chr "m_66" "m_66" "m_312" "m_344" ...
## $ treatment_ID : chr "trt_185" "trt_186" "trt_708" "trt_768" ...
## $ genus : chr "Araneus" "Araneus" "Argiope" "Rabidosa" ...
## $ spcs : chr "Araneus diadematus" "Araneus diadematus" "Argiope bruennichi" "Rabidosa punctulata" ...
## $ cannibal : chr "female" "female" "female" "female" ...
## $ mate_status : chr "virgin" "mated" "virgin" "virgin" ...
## $ behaviour : chr "cannibal" "cannibal" "cannibal" "cannibal" ...
## $ breakdown : chr "1st male" "2nd male" NA NA ...
## $ response : chr "cannibal small" "cannibal small" "copulation duration" "cannibal condition" ...
## $ general_response: chr "cannibal size" "cannibal size" "copulation duration" "cannibal condition" ...
## $ exprt : chr "lab" "lab" "field" "lab" ...
## $ habitat : chr "field" "field" "field" "field" ...
## $ data : chr "text" "text" "text" "text" ...
## $ occur : chr "post" "post" "post" "pre" ...
## $ yi : num 0.407 0.435 0.436 0.114 Inf ...
## $ vi : num 0.0573 0.0575 0.0465 0.1812 Inf ...
## $ adaptive : chr "Y" "Y" "N" "Y" ...
## $ aggressive : chr "Y" "Y" "N" "Y" ...
## $ parental : chr "N" "N" "N" "N" ...
## $ choice : chr "Y" "Y" "Y" "N" ...
## $ es_type : chr "est_ate_n_ttest_hedge_g01" "est_ate_n_ttest_hedge_g02" "est_ate_n_ttest_hedge_g03" "est_ate_n_ttest_hedge_g04" ...
This study used partial omega^2 effect size. I used this effect size calculator (https://effect-size-calculator.herokuapp.com/) and this effect size converter (https://www.escal.site/) to get Cohens d and converted it to Hedge g. SE calculated=upper-Lower/3.92, then squared for variance
## 'data.frame': 9 obs. of 25 variables:
## $ ID : chr "ft163" "ft163" "ft163" "ft163" ...
## $ year : int 2014 2014 2014 2014 2014 2014 2014 2014 2014
## $ es_ID : chr "es_943" "es_944" "es_945" "es_946" ...
## $ female_ID : chr "f_354" "f_355" "f_356" "f_357" ...
## $ male_ID : chr "m_387" "m_388" "m_389" "m_390" ...
## $ treatment_ID : chr "trt_832" "trt_833" "trt_834" "trt_835" ...
## $ genus : chr "Habronattus" "Habronattus" "Habronattus" "Habronattus" ...
## $ spcs : chr "Habronattus pyrrithrix" "Habronattus pyrrithrix" "Habronattus pyrrithrix" "Habronattus pyrrithrix" ...
## $ cannibal : chr "female" "female" "female" "female" ...
## $ mate_status : chr "unknown" "unknown" "unknown" "unknown" ...
## $ behaviour : chr "attack" "attack" "attack" "attack" ...
## $ breakdown : chr NA NA NA NA ...
## $ response : chr NA NA NA "SSD" ...
## $ general_response: chr NA NA NA "SSD" ...
## $ exprt : chr "lab" "lab" "lab" "lab" ...
## $ habitat : chr "field" "field" "field" "field" ...
## $ data : chr "table" "table" "table" "table" ...
## $ occur : chr "pre" "pre" "pre" "pre" ...
## $ yi : num 0 0 0 0.581 0 ...
## $ vi : num 0.162 0.348 0.166 0.405 0.218 ...
## $ adaptive : chr "Y" "Y" "Y" "Y" ...
## $ aggressive : chr "Y" "Y" "Y" "Y" ...
## $ parental : chr "N" "N" "N" "N" ...
## $ choice : chr "N" "N" "N" "N" ...
## $ es_type : chr "omegasqrt_hedge_g01" "omegasqrt_hedge_g02" "omegasqrt_hedge_g03" "omegasqrt_hedge_g04" ...
## Classes 'escalc' and 'data.frame': 940 obs. of 26 variables:
## $ ID : chr "ft003" "ft003" "ft003" "ft003" ...
## $ year : int 2011 2011 2011 2011 2011 2011 2011 2011 2011 2011 ...
## $ es_ID : chr "es_6" "es_7" "es_8" "es_9" ...
## $ female_ID : chr "f_2" "f_3" "f_4" "f_2" ...
## $ male_ID : chr "m_2" "m_3" "m_4" "m_2" ...
## $ treatment_ID : chr "trt_6" "trt_7" "trt_8" "trt_9" ...
## $ genus : chr "Allocosa" "Allocosa" "Allocosa" "Allocosa" ...
## $ spcs : chr "Allocosa brasiliensis" "Allocosa brasiliensis" "Allocosa brasiliensis" "Allocosa brasiliensis" ...
## $ cannibal : chr "male" "male" "male" "male" ...
## $ mate_status : chr "unknown" "unknown" "unknown" "unknown" ...
## $ behaviour : chr "attack" "attack" "attack" "attack" ...
## $ breakdown : chr "mated female" "virgin & mated females" "virgin female" "mated female" ...
## $ response : chr "cannibal condition" "cannibal condition" "cannibal condition" "cannibal mass" ...
## $ general_response: chr "cannibal condition" "cannibal condition" "cannibal condition" "cannibal size" ...
## $ exprt : chr "lab" "lab" "lab" "lab" ...
## $ habitat : chr "field" "field" "field" "field" ...
## $ data : chr "table" "table" "table" "table" ...
## $ occur : chr "pre" "pre" "pre" "pre" ...
## $ yi : num -0.5203 -0.2873 -0.0879 0.0564 -1.1463 ...
## ..- attr(*, "measure")= chr "SMD"
## $ vi : num 0.233 0.137 0.396 0.226 0.153 ...
## $ adaptive : chr "Y" "Y" "Y" "Y" ...
## $ aggressive : chr "Y" "Y" "Y" "Y" ...
## $ parental : chr NA NA NA NA ...
## $ choice : chr NA NA NA NA ...
## $ es_type : chr "median_SMD01" "median_SMD02" "median_SMD03" "median_SMD04" ...
## $ precision : num 2.07 2.7 1.59 2.1 2.56 ...
## - attr(*, "yi.names")= chr "yi"
## - attr(*, "vi.names")= chr "vi"
## - attr(*, "digits")= Named num [1:9] 4 4 4 4 4 4 4 4 4
## ..- attr(*, "names")= chr [1:9] "est" "se" "test" "pval" ...