Risk Aversion AnalysisSource:
Set-up analysis using smoking cessation data set.
Run the risk aversion analysis straight away with both the base R and ggplot2 versions of plots.
Notice that the first value is asymptotically zero but the function handles that for us. Previously, you had to use something like 1e-10 which was a bit awkward.
Now we modify the comparison group so that it doesn’t contain 2 (“self-help”) anymore. We still keep the same first comparison though “no intervention”.
If we rerun the analysis we should see that the output is exactly the same.
What happens when we only have one risk adjustment value? Set it to
zero so this should be exactly the same as the baseline
Check that unusual or meaningless values for
handled gracefully. At present the are just calculated and plotting
exactly the same way. should we limit values?
If we select a new set of comparison interventions what will happen?
There are specified in a different order and for other plots this makes
very little difference (perhaps changing the line types). However, it is
CEriskav() because only the first comparison
intervention is plotted so changing the order changes the plot. We can
see this by swapping “non intervention” and “individual counselling”
interventions from the analysis above.
The previous version of
CEriskav() had a
comparison argument where you could specify the single
intervention to plot and if this wasn’t set then it defaulted to the
first. It seems neater to separate the definition of the analysis with
the plotting so now if you did want to specify a different comparison
intervention when using
CEriskav() then you would have to
setComparison() first and then call the plotting
Check legend position argument:
plot(bcea_smoke, pos = TRUE)
plot(bcea_smoke, pos = FALSE)
plot(bcea_smoke, pos = "topleft")
plot(bcea_smoke, pos = "topright")
plot(bcea_smoke, pos = "bottomleft")
plot(bcea_smoke, pos = "bottomright")
plot(bcea_smoke, graph = "ggplot", pos = TRUE)
plot(bcea_smoke, graph = "ggplot", pos = FALSE)
plot(bcea_smoke, graph = "ggplot", pos = "top")
plot(bcea_smoke, graph = "ggplot", pos = "bottom")
plot(bcea_smoke, graph = "ggplot", pos = "left")
plot(bcea_smoke, graph = "ggplot", pos = "right")