Good reading for handon SR and metanalysis: https://bookdown.org/MathiasHarrer/Doing_Meta_Analysis_in_R/forest.html First install package meta
#install.packages("meta")
Load the excel sheet preferably in csv document
library(readr)
library(meta)
## Loading 'meta' package (version 6.5-0).
## Type 'help(meta)' for a brief overview.
## Readers of 'Meta-Analysis with R (Use R!)' should install
## older version of 'meta' package: https://tinyurl.com/dt4y5drs
Storke_Physical <- read_csv("~/Documents/OneDrive/2_Apple/My_reading_material/R/Storke_Physical.csv")
## Rows: 5 Columns: 4
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (1): Author and year
## dbl (3): Sample size, Mean, SD
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
View(Storke_Physical)
## Warning in system2("/usr/bin/otool", c("-L", shQuote(DSO)), stdout = TRUE):
## running command ''/usr/bin/otool' -L '/Library/Frameworks/R.framework/Resources/
## modules/R_de.so'' had status 1
attach(Storke_Physical)
We plan to do metanalysis of means using metamean
Stroke_physical <- metamean(`Sample size`, Mean, SD, `Author and year`, data = NULL, subset = NULL,exclude = NULL,sm = gs("smmean"), text.random = gs("text.random"), text.w.random = gs("text.w.random") )
Stroke_physical
## Number of studies: k = 5
## Number of observations: o = 501
##
## mean 95%-CI
## Common effect model 46.3423 [45.2525; 47.4321]
## Random effects model 46.8561 [39.7355; 53.9767]
##
## Quantifying heterogeneity:
## tau^2 = 64.3874 [22.0440; 545.5211]; tau = 8.0242 [4.6951; 23.3564]
## I^2 = 97.4% [95.9%; 98.4%]; H = 6.25 [4.93; 7.94]
##
## Test of heterogeneity:
## Q d.f. p-value
## 156.47 4 < 0.0001
##
## Details on meta-analytical method:
## - Inverse variance method
## - Restricted maximum-likelihood estimator for tau^2
## - Q-Profile method for confidence interval of tau^2 and tau
## - Untransformed (raw) means
Construct a forest plot
forest.meta(Stroke_physical, layout = "JAMA")
#forest.meta(Stroke_physical, layout = "RevMan5")
Test for bias - egger test
Stroke_physical_egger <- metabias(Stroke_physical, method.bias = "linreg", k.min = 5)
Stroke_physical_egger
## Linear regression test of funnel plot asymmetry
##
## Test result: t = 0.67, df = 3, p-value = 0.5515
##
## Sample estimates:
## bias se.bias intercept se.intercept
## 21.0650 31.4988 20.2720 39.1629
##
## Details:
## - multiplicative residual heterogeneity variance (tau^2 = 45.3898)
## - predictor: standard error
## - weight: inverse variance
## - reference: Egger et al. (1997), BMJ
Funnel plot
funnel(Stroke_physical)