Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable multiplicative delta in tipping point analysis #278

Open
nociale opened this issue Jan 18, 2022 · 5 comments
Open

Enable multiplicative delta in tipping point analysis #278

nociale opened this issue Jan 18, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@nociale
Copy link
Collaborator

nociale commented Jan 18, 2022

This might be useful to implement "multiplicative" delta strategies, e.g. delta = alpha*y

@nociale nociale added this to the CRAN Release milestone Jan 18, 2022
@gowerc gowerc removed this from the CRAN Release milestone Jan 24, 2022
@gowerc gowerc added the enhancement New feature or request label Jan 24, 2022
@gowerc gowerc changed the title add outcome values to delta template data.frame Enable multiplicative delta in tipping point analysis Feb 2, 2022
@gowerc
Copy link
Collaborator

gowerc commented Feb 6, 2022

@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
)

@nociale
Copy link
Collaborator Author

nociale commented Feb 7, 2022

@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:

  1. delta_fun() takes an imputed dataset, adds a column "delta" containing the delta adjustment (not the new adjusted outcomes) and returns this dataset.
  2. This dataset is then internally used as a "delta" dataset to implement the user-specified delta strategy as per output of delta_fun().
  3. This is repeated for each imputed dataset. This is basically the main difference with respect to the current implementation. The delta value is different for each imputed dataset since it depends on the imputed values..

Correct or I misunderstood something?

@wolbersm
Copy link
Collaborator

@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.

@gowerc
Copy link
Collaborator

gowerc commented Mar 10, 2022

@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

@wolbersm
Copy link
Collaborator

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants