I am conducting a meta-analysis. I am using the influence()
command for outlier detection.
So what I did is the following:
outlier1 <- influence(result)
print(outlier1)
This gives me 250 entries indicating whether a study has to be excluded. Then I have to delete outlier studies by indicating the row. And here's the thing: I have 250 studies, and I don't want to count the rows manually in order to know which studies to exclude.
Here's what the result looks like:
Study Indicator_1 Indicator_N Outlier?
------------------------------------
(250 entries)
Now I would like to know how I can alter the printed result such that it looks like:
Number Study Indicator_1 Indicator_N Outlier?
--------------------------------------------
Counting should optimally start at 1.
Here is the data and code-sequence required for creating a reproducible example:
Data: http://www.filedropper.com/metadaten
Code sequence:
install.packages("xlsx")
install.packages("metafor")
library(xlsx)
library(metafor)
input <-read.xlsx("C:/Users/feal/Documents/BA_MA/Data/01. ID FP/meta_daten.xlsx", sheetName="input")
## View(input)
result <-rma(yi=zcor, vi=var, data=input,
measure="GEN", method="REML", level=95,
slab=paste(author, pub_date, sep=", "))
print(result)
outlier1 <- influence(result)
print(outlier1)
After that I get the following results, a star on the right indicates that the outlier has to be removed.
Remove function as for an example:
input_out1 <-input[-19,]
print(input_out1)
I just want every column to have an entry number. Or every entry to be removed, where there is a star on the right.