Closed JanionNevill closed 5 months ago
Sorry, one more change. When the outcome is binary, the y-axis labels should be on the odds ratio scale, rather than the log-odds ratio-scale. Naomi did this in her graph using ggplot2::scale_y_continuous
.
Sorry, one more change. When the outcome is binary, the y-axis labels should be on the odds ratio scale, rather than the log-odds ratio-scale. Naomi did this in her graph using
ggplot2::scale_y_continuous
.
It already does this:
Currently it only allows treatment effect parameters. There are also covariate parameters to be added. I was thinking there could be two drop-down lists, each with its own "add all" button. If they were all in the same list it might get too crowded when you add all.
I'm afraid that I have no idea what you're talking about here 😳 That's my lack of statistical knowledge showing through...
I'm afraid that I have no idea what you're talking about here 😳 That's my lack of statistical knowledge showing through...
:laughing: Actually I was getting confused, and what I wrote didn't make sense! I was thinking there were two lines per treatment, but actually there are two contributions per study per treatment. One of them is the circle that is there now, which is for the d parameter (treatment effect), and the other isn't there which is for the beta parameter (treatment-by-covariate interaction). If you look at figure 8 of the Donegan paper (attached to the Jira task) where we got the graph from, there are two circles per study. The red one is the d and the blue one is the beta. They have one treatment effect per graph, so it makes sense for them to have both circles. We have multiple treatment effects in the same graph, so I don't think we should put both circles in as it will become too busy.
So, forget what I said about there being two drop down lists. What we actually need is where the "show contributions" tick box is, there need to be three options: show treatment effect contributions, show covariate effect contributions, or nothing.
You got the treatment effect contributions from the columns ending in _d in the contribution matrix. The covariate contributions come from the columns ending in _beta (except for the shared covariate parameters, where there is only one column called B, and this column applies to all treatments).
Clear as mud?
Clear as mud?
As mud indeed 😅
What we actually need is where the "show contributions" tick box is, there need to be three options: show treatment effect contributions, show covariate effect contributions, or nothing.
Is this different to the selection of "contribution" vs. "weight"?
There should be a warning displayed on the screen, something like this: "Contributions cannot be determined. This possibly indicates a poorly fitting model. Please check model diagnostics in the Result Details and Deviance Report tabs".
It already does show a warning when the contribution matrix is uncalculatable. I will make the message more clear though.
Sorry, one more change. When the outcome is binary, the y-axis labels should be on the odds ratio scale, rather than the log-odds ratio-scale. Naomi did this in her graph using
ggplot2::scale_y_continuous
.It already does this:
It isn't working. You can tell by comparing the forest plot, which is on the odds-ratio scale, to the graph which is still on the log-odds-ratio scale.
Clear as mud?
As mud indeed 😅
What we actually need is where the "show contributions" tick box is, there need to be three options: show treatment effect contributions, show covariate effect contributions, or nothing.
Is this different to the selection of "contribution" vs. "weight"?
Yes, the two sets of parameters are always included in the output, regardless of which options are selected.
Sorry, one more change. When the outcome is binary, the y-axis labels should be on the odds ratio scale, rather than the log-odds ratio-scale. Naomi did this in her graph using
ggplot2::scale_y_continuous
.It already does this:
It isn't working. You can tell by comparing the forest plot, which is on the odds-ratio scale, to the graph which is still on the log-odds-ratio scale.
I'd passed the wrong object to the function, that's why it wasn't working. I've fixed that now, but it's not displaying correctly, possibly due to the centring/normalising of the covariate value.
I will try to fix this, but if you have any insights which would be useful, please let me know.
So, forget what I said about there being two drop down lists. What we actually need is where the "show contributions" tick box is, there need to be three options: show treatment effect contributions, show covariate effect contributions, or nothing.
You got the treatment effect contributions from the columns ending in _d in the contribution matrix. The covariate contributions come from the columns ending in _beta (except for the shared covariate parameters, where there is only one column called B, and this column applies to all treatments).
I've implemented this now, but it'll need thorough checking, because I'm not 100% sure that I've understood the concept fully. When using "Shared" regression, every study contributes to every regression, regardless of the shape of the network.
I'd passed the wrong object to the function, that's why it wasn't working. I've fixed that now, but it's not displaying correctly, possibly due to the centring/normalising of the covariate value.
I will try to fix this, but if you have any insights which would be useful, please let me know.
I think the trans
parameter is transforming the y-axis itself, whereas we only want the y-axis labels to change. So it should be exactly as Naomi has it, using the labels
parameter but with plogis
replaced by exp
in the function definition.
I think I've addressed everything now...
I've implemented this now, but it'll need thorough checking, because I'm not 100% sure that I've understood the concept fully. When using "Shared" regression, every study contributes to every regression, regardless of the shape of the network.
In shared regression there is one covariate parameter, and the studies that contribute to this parameter are precisely those that have the reference treatment. So what you've programmed is correct.
In shared regression there is one covariate parameter, and the studies that contribute to this parameter are precisely those that have the reference treatment. So what you've programmed is correct.
Just to check, are the direct and indirect contributions done correctly?
Just to check, are the direct and indirect contributions done correctly?
I believe so.
Actually, as I was checking that I have found two issues.
Show contributions = "Covariate Effect"
and Study circle sized by = "Absolute contribution"
. Then compare Contribution type
between "weight" and "contribution". You'll see that the y-axis changes and drops off one of the circles when the contribution type is "weight".
Cert_four_arms.csv
- In regression_plot_panel.R there is test code on line 349.
- The axes don't always react appropriately to the input changing. Run the attached data set with "shared" then change the options on the graph to
Show contributions = "Covariate Effect"
andStudy circle sized by = "Absolute contribution"
. Then compareContribution type
between "weight" and "contribution". You'll see that the y-axis changes and drops off one of the circles when the contribution type is "weight".
I haven't been able to test this in the app with a data set with more than 2 arms, as the base contribution matrix function throws an error with the 4-arm data set provided. Unit tests do use a data set with 3 arms though.