Open nociale opened 2 years ago
@nociale
For reference the original proposed solution was to add the outcome value onto the delta_template but we realised this isn't viable as it is different between each imputed dataset
I was just thinking, a solution for this could be the ability to provide a function instead of a data.frame (though providing a data.frame would still be the default and recommend way to do delta adjustment). The function would take a dataframe as its input and return a delta dataframe as its output, this way we can hand over the delta_template data.frame but with the outcome value attached for each iteration across the different imputed datasets. i.e.
delta_fun <- function(df) {
df %>%
mutate(delta = outcome * 1.3)
}
analysis(
...
delta = delta_fun
)
@gowerc I agree this solution would work! Could you just clarify what do you mean by "we can hand over the delta_template data.frame but with the outcome value attached for each iteration across the different imputed datasets".
Procedure:
delta_fun()
takes an imputed dataset, adds a column "delta" containing the delta adjustment (not the new adjusted outcomes) and returns this dataset.delta_fun()
.Correct or I misunderstood something?
@gowerc and @nociale, I am really not convinced whether such an enhancement is needed within rbmi
.
I am also a bit wary about mixing the additive scale (on which all our models run) with a multiplicative scale for this single enhancement.
@wolbersm , Even if we don't directly support multiplicative scaling I do quite like the idea of allowing users to provide functions as the input which manipulate the datasets on each iteration as this allows us to attach the outcome variable for each imputed dataset which gives a lot more flexibility for non-additive scaling i.e. add +3 if outcome > 10
@gowerc Thanks for explaining, I agree this would be a neat addition. However, I am really not sure how often this would actually be used in practice. My sense is that people will mostly use simple delta-adjustments and I think we currently provide enough flexibility for this.
This might be useful to implement "multiplicative" delta strategies, e.g. delta = alpha*y