-
Notifications
You must be signed in to change notification settings - Fork 0
/
te_metaanalysis.Rmd
79 lines (69 loc) · 2.04 KB
/
te_metaanalysis.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
---
title: "TE Meta-analysis"
author: "Alvin Tan"
date: "2022-03-09"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(tidyverse)
library(meta)
```
## Import data
```{r import, include=FALSE}
data_df <- read_tsv("data.tsv") |>
select(!(`Publication Year`:Url)) |>
mutate(`%TE` = as.double(`%TE`),
`%TE(either)` = as.double(`%TE(either)`),
Measure = fct_recode(`C/P`, "Comprehension" = "C", "Production" = "P"),
`Study name` = sub("–", "-", `Study name`))
```
```{r descriptives}
num_te_discuss <- sum(data_df$`Discusses TEs?`, na.rm = TRUE)
langs_list <- list()
for (i in data_df$Langs) {
langs_list <- c(langs_list, str_split(i, ","))
}
langs_list <- langs_list |> unlist()
langs_hist <- langs_list |> table() |> as_tibble()
studies_con <- data_df |>
filter(!is.na(`SD(%TE)`))
num_studies_con <- studies_con |> nrow()
studies_lib <- data_df |>
filter(!is.na(`SD(%TE(either))`))
num_studies_lib <- studies_lib |> nrow()
```
```{r lang-hist}
lh <- ggplot(data = langs_hist, aes(x = reorder(langs_list, -n), y = n)) +
geom_col() +
xlab("Language")
lh
```
```{r meta-analysis}
ma_con <- metamean(n = N,
mean = `%TE(either)`,
sd = `SD(%TE(either))`,
studlab = `Study name`,
data = studies_con,
sm = "MRAW",
random = TRUE,
method.tau = "REML",
title = "Proportion of TEs",
subgroup = Measure)
summary(ma_con)
ma_lib <- metamean(n = N,
mean = `%TE(either)`,
sd = `SD(%TE(either))`,
studlab = `Study name`,
data = studies_lib,
sm = "MRAW",
random = TRUE,
method.tau = "REML",
title = "Proportion of TEs",
subgroup = Measure)
summary(ma_lib)
```
```{r forest}
forest.meta(ma_con, sortvar = `%TE(either)`)
forest.meta(ma_lib, sortvar = `%TE(either)`)
```