Suggestion: predicted effect size corrected for unbalanced covariates #225
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.
#224
When methylation difference is calculated there are 3 options for effect size calculation: weighted mean, unweighted mean and model prediction (
predicted
). All of these options calculate or estimate effect size (i.e., methylation difference) which is due both to the group (e.g., treatment vs. control) as well as due to covariates, when they are present/used, and if they are unbalanced (i.e., different) across the treatment groups.I suggest an additional simple calculation for an average effect size prediction, corrected for covariates (named
predicted2
in the new piece of the code). Basically, all covariate sets found in any of the treatment groups will be used in all groups in making model predictions. The rest is the same. In that case the predicted effect will not be due to difference in covariates, will be based on covariate sets used in the data, and will agree with reported statistical significance for group effect. This is also what might be of interest to the user (as a note, it might make sense to return all effect size calculations together, not just one, so that there is no need to rerun the function to get a different version of effect size estimate.)