-
Notifications
You must be signed in to change notification settings - Fork 3
/
2_script_file.R
42 lines (26 loc) · 999 Bytes
/
2_script_file.R
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
# Function to install packages is install.packages()
install.packages('metafor')
# It will ask for a download location.
# Pick the closest one. Turkey, Greece, Austria
# would be fine.
# Import metafor package to the working environment.
library('metafor')
# Change "dat.bcg" with the full path that you
# acquired.
data("dat.bcg", package = "metafor")
# Print data set to the screen. You do not want to
# see row names, hence 'row.names=FALSE' is in the
# print() function.
print(dat.bcg, row.names=FALSE)
# Model fitting with rma() function. You have to assing
# output of the rma() function or it is printed to the
# screen and lost.
res <- rma(ai=tpos, bi=tneg, ci=cpos, di=cneg,
measure="RR", data=dat.bcg)
# By assigning output to a name you can be able to
# reach and see it again.
res
# Calculating confidence intervals with confint() function.
confint(res)
# Creating forest plots with forest() function.
forest(res)