mcguinlu / robvis

A package to quickly visualise risk-of-bias assessment results
https://mcguinlu.github.io/robvis/
Other
58 stars 22 forks source link

ROBINS-I plots can't deal with 'NI' (No information) #149

Closed befriendabacterium closed 5 months ago

befriendabacterium commented 8 months ago

Describe the bug The ROBINS-I tool allows for the Domain or Overall RoB judgement to be 'No information' (coded as NI) where there is no information to base risk of bias judgement on.

To Reproduce

# load example data
data <- data_robins
data$Study <- paste("Study",seq(1,nrow(data)))
#coerce to character to simulate reading ina raw .csv file
data<-as.data.frame(apply(data,2,as.character))
#replace one judgement with 'NI
data$D7[1]<-'NI'
# Plot 
rob_traffic_light(data, tool = "ROBINS-I", psize = 10)

Doing this screws up the 'Serious' judgements, such that they are plotted as grey (i.e. no colour) like the 'NI' ones and not included in the legend

Expected behavior 'Serious' should be plotted as cherry red, and NI should be plotted as grey. Both should be included in Judgement legend.

Screenshots image

Desktop (please complete the following information):

Additional context Ignore the other issues in the plot, i've flagged them elsewhere. Thanks for making this package, still a lot easier than doing myself!

befriendabacterium commented 8 months ago

FYI this issue also seems to displace the Domains caption of the y axis so it overlaps with traffic lights (see screenshot)

mcguinlu commented 6 months ago

Hi @befriendabacterium,

Thanks for raising this issue and for your patience while I got to it!

Based on the fact you are using data_robins vs data_robins_i, it seems likely you are using the CRAN version of robvis, which does not support "No information" as a judgement in rob_traffic_light().

If you use the latest development version from GitHub (via devtools::install_github("mcguinlu/robvis")), "No information" will be supported.

In fact, the example data for ROBINS-I included with the development version of the package already contains some "No information" judgements:

head(data_robins_i, 2)
Study D1 D2 D3 D4 D5 D6 D7 Overall
Study 1 Moderate Critical Low Low Moderate Moderate Moderate Critical
Study 2 Moderate No information Moderate Low Low Low Moderate Moderate



Passing this example dataset to the rob_traffic_light() function gives the following:

rob_traffic_light(data_robins_i, "ROBINS-I")

rob_figure



The CRAN version of robvis is now quite out of date, so in general you are better off using the dev version, as it contains fixes for a lot of issues that have cropped up in the years since robvis was first released. It's been on my radar for a while to release a new version, but I haven't quite found the time to dedicate to it yet!

befriendabacterium commented 5 months ago

Hi Luke,

Thanks for this and additional context re current CRAN version. Installed dev version and can confirm it fixes this issue with the correct inputs.

Thanks Matt