Discussion: View Thread

  • 1.  Seeking suggestions for a graphical display

    Posted 06-22-2022 18:50
    Dear Colleagues,

    My client wishes to have the information in Table 1 below displayed graphically.  Does anyone have suggestions regarding approaches to getting this done?  I will also be reading references that I have acquired since my last query regarding graphical displays to try to glean some ideas.

    Regards

    Novie

    ------------------------------
    Novie Younger-Coleman
    Statistician
    Caribbean Institute for Health Research, UWI, Mona, Jamaica
    ------------------------------


  • 2.  RE: Seeking suggestions for a graphical display

    Posted 06-22-2022 21:14
    You might want to consider something akin to a Cleveland dotplot, with the estimate in the center of a line segment that indicates the extent of the CI.  I've done something similar in my current project using the segplot() function in latticeExtra package in R.  R may be overkill if this is a one-off table in need of a one-off graph, but the visual concept of segments with marked centers is the point. On the other hand, if this is just one piece of a larger automated workflow, then R might be the way to go.

    This is not a working example but might give you someplace to start:

    library(lattice)
    library(latticeExtra)
    library(forcats)  ## for the fct_rev() function below

    ## x is a dataframe with four variables: label, estimate, lower bound of CI, and upper bound of CI
    ## label would be your column "Effect (Factor). 
    ## you might be able to use your "Subgroup" as a factor to plot the CIs in different panels; I have not tried that.
    ## Note that your estimates and CI bounds are already exponentiated into ORs, so you would have to change that in the below.

    my.segplot.OR.f <- function(x){
    segplot(fct_rev(label) ~ exp(lwr) + exp(upr), data = x,
    main = "Effect of GUV on pre-school absenteeism",
    xlab = "estimated odds ratio and simultaneous one-sided 95% confidence intervals",
    draw.bands = FALSE, centers = exp(estimate), pch = 19, cex = 1.5,
    segments.fun = panel.arrows,
    ends = "first", angle = 45, length = .15,
    lwd = 2,
    # par.settings = simpleTheme(pch = 19, col = 1),
    # xlab = expression("Number " %+-% " SE"),
    panel = function(x, y, z, ...) {

    panel.abline(v = 1, col = "darkgrey", lty = 2)
    panel.segplot(x, y, z, ...)})
    }​​​​​​

    ------------------------------
    Christopher Ryan
    Clinical Associate Professor of Family Medicine
    ------------------------------



  • 3.  RE: Seeking suggestions for a graphical display

    Posted 06-24-2022 17:15
    Thanks very much for introducing me to the Cleveland dot plot, Christopher. 
    Subsequent to receiving your message I was looking at this web page that also features use for R to create the dot plot. (3.10 Making a Cleveland Dot Plot | R Graphics Cookbook, 2nd edition)

    I believe it would only show one side of the confidence interval for the odds ratio and my client prefers to have both sides displayed. I will also check out the effects package you recommended.  
    A popular recommendation from this group is use of the forest plot and my client seems to prefer that option.
    However, I certainly hope to upgrade my skills at creating graphical displays such as the Cleveland dot plot and other suggestion made by other colleagues in this group.

    Thanks, again, for your suggestions

    Regards

    Novie

    ------------------------------
    Novie Younger-Coleman
    Statistician
    Caribbean Institute for Health Research, UWI, Mona, Jamaica
    ------------------------------



  • 4.  RE: Seeking suggestions for a graphical display

    Posted 06-22-2022 21:22
    Oh and I forgot: if using R, the effects package might also be useful. I believe it is designed for this very purpose, although I am only just now learning about it.

    ------------------------------
    Christopher Ryan
    Clinical Associate Professor of Family Medicine
    ------------------------------



  • 5.  RE: Seeking suggestions for a graphical display

    Posted 06-22-2022 21:34
    You might consider providing the estimates for each group separately (e.g., separate rows for males and females), and then adding a boxplot for each group in a column. You can create such a table using the reactable package in R. Just a quick suggestion.
    Cheers,

    ------------------------------
    Robert Podolsky
    Biostatistician
    ------------------------------



  • 6.  RE: Seeking suggestions for a graphical display

    Posted 06-23-2022 06:15
    Hi,
    You might want to consider doing something like in the image below:


    CMF stands for Crash Modification Factor and it represents the impact of a variable in a crash prediction model expressed as a multiplicative change to the prediction, which has a very similar interpretation to the odds ratio.

    Cheers,

    R

    ------------------------------
    Raul E. Avelar, Ph.D., P.E., PMP
    Research Scientist
    Roadway Safety Program Manager
    Texas A&M Transportation Institute
    ------------------------------



  • 7.  RE: Seeking suggestions for a graphical display

    Posted 06-23-2022 14:19
    Forest plots offer an effective way to display numerous estimates and CIs for odds ratios and hazard ratios--as well as posterior medians and probability (credible) intervals under Bayesianism.

    If you google "forest plots" you will see many; here is a correct one I found. Way too many are incorrect, because they fail to use log-scaling on the X (OR or HR) axis. Because the polarity is arbitrary, the HR = 1/2 and HR = 2 should be equal distance from 1. And please make the labels of the OR axis in terms of OR, and not log(OR). 1/8, 1/4, 1/2, 1, 2, 4, 8 will be equally spaced. Here, they correctly used 1/100, 1/10, 1, 100, but they clipped before 100. Unless the p-values for testing H0: OR -1 are interesting (rarely!), you should leave them out.   Forest plot with HR table.
    RStudio Community remove preview
    Forest plot with HR table
    Hello everyone, I'm still pretty new at R, so I hope this is not an obvious question. I'm currently trying to visualize my data in a forest plot. For each gene, I have 2 HR for survival data, with respective CI and p-value.
    View this on RStudio Community >







    ------------------------------
    Ralph O'Brien
    Professor of Biostatistics (officially retired; still keenly active)
    http://rfuncs.weebly.com/about-ralph-obrien.html
    ------------------------------



  • 8.  RE: Seeking suggestions for a graphical display

    Posted 06-23-2022 17:12
    Oops. Of course that should have been, "Here, they correctly used 1/100, 1/10, 1, 10, 100, but they clipped before 100."

    ------------------------------
    Ralph O'Brien
    Professor of Biostatistics (officially retired; still keenly active)
    http://rfuncs.weebly.com/about-ralph-obrien.html
    ------------------------------



  • 9.  RE: Seeking suggestions for a graphical display

    Posted 06-24-2022 17:39
    Dear Ralph,
    Thanks very much for your suggestions and very useful  guidance regarding use of the log scale on the X (OR) axis when doing the forest plot.

    Regards

    Novie


    ------------------------------
    Novie Younger-Coleman
    Statistician
    Caribbean Institute for Health Research, UWI, Mona, Jamaica
    ------------------------------