Fix Issue #8: Transform continuous outcome estimates back to original scale #30
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🎯 Overview
This PR addresses Issue #8 by implementing continuous outcome rescaling to transform variable importance estimates from the [0,1] scale back to the original outcome scale.
🔧 Problem
Variable importance estimates for continuous outcomes were being reported on the [0,1] scale instead of the original outcome scale, making results difficult to interpret. For example, if the original outcome ranged from 10-50, estimates were being reported as values between 0-1 rather than meaningful values in the 10-50 range.
💡 Solution
Core Changes
Modified
estimate_pooled_results():Qboundsandmap_to_ystarparameters to accept outcome bounds informationUpdated
vim_numerics()andvim_factors():Qboundsandmap_to_ystarparameters toestimate_pooled_results()Technical Implementation
The rescaling uses the formula:
Where
upper_boundandlower_boundare the original outcome variable's range.📝 Files Changed
R/estimate_pooled_results.R- Core rescaling logicR/vim-factors.R- Pass bounds for factor variable analysisR/vim-numerics.R- Pass bounds for numeric variable analysistests/testthat/test-continuous-outcome-scale.R- Comprehensive test suiteNEWS.md- Documentation of the fix🧪 Testing
Added comprehensive test suite that verifies:
The continuous outcome rescaling logic is implemented but currently has test failures where
vim$results_allis NULL. This suggests the rescaling changes may be interfering with VIM calculations and requires additional debugging to ensure the transformation doesn't break the core functionality.🎯 Next Steps
📚 Related