Hi I am very new to using R but I am creating a forest plot for diagnostic test accuracy meta analysis using the meta package in R. I have performed a subgroup analysis and created my plot but I want to get rid of the words ‘subgroup = subgroupname’ and just have the subgroup name. Is this possible? The ‘subgroup’ is the name of this column in my dataframe. If I make it blank, R automatically calls it X, so it appears as ‘X = subgroupname’. This is my code so far:
SR2_filtered <- SR2[SR2$subgroup != "Missing", ]
subgroup_sens3_filtered <- metaprop(SR2_filtered$TP, SR2_filtered$TP + SR2_filtered$FN,
byvar = SR2_filtered$subgroup,
comb.fixed = FALSE, comb.random = TRUE, sm = "PRAW",
method.ci = "CP", studlab = SR2_filtered$Author)
subgroup_spec3_filtered <- metaprop(SR2_filtered$TN, SR2_filtered$TN + SR2_filtered$FP,
byvar = SR2_filtered$subgroup,
comb.fixed = FALSE, comb.random = TRUE, sm = "PRAW",
method.ci = "CP", studlab = SR2_filtered$Author)
forest(subgroup_sens3_filtered, xlab = "Sensitivity",
col.square="cornflowerblue",
col.square.lines="navy",
col.diamond="red",
colgap.left = "18mm")
forest(subgroup_spec3_filtered, xlab = "Specificity",
col.square = "cornflowerblue",
col.square.lines = "navy",
col.diamond = "red",
colgap.left = "18mm")
snapshot of the relevant bit of my plot
I have tried various suggestions from chat gpt but no success and I'm just going round in circles as all suggestions seem to be trying to modify the text but the text comes through automatically in the forest plot
Priya is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.