-
Notifications
You must be signed in to change notification settings - Fork 12
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
Fix #462 - capture KRI and other associated metadata #527
Conversation
@jwildfire - This should be good for your preliminary review to make sure the new skeleton is as intended. Definitely happy to schedule a time to run through everything if that's more convenient. |
R/AE_Assess.R
Outdated
@@ -127,13 +127,13 @@ AE_Assess <- function( | |||
) | |||
} | |||
|
|||
lAssess$dfAnalyzed <- gsm::Analyze_Wilcoxon(lAssess$dfTransformed, "Rate", bQuiet = bQuiet) | |||
lAssess$dfAnalyzed <- gsm::Analyze_Wilcoxon(lAssess$dfTransformed, "KRI", bQuiet = bQuiet) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As noted below, we can update the default to KRI and remove here.
R/IE_Assess.R
Outdated
@@ -14,6 +14,7 @@ | |||
#' @param dfInput `data.frame` Input data, a data frame with one record per subject. | |||
#' @param nThreshold `numeric` Threshold specification. Default: `0.5` | |||
#' @param lTags `list` Assessment tags, a named list of tags describing the assessment that defaults to `list(Assessment="IE")`. `lTags` is returned as part of the assessment (`lAssess$lTags`) and each tag is added as a column in `lAssess$dfSummary`. | |||
#' @param strScoreLabel Optional. `character` vector to describe the `Score` column. Default: `Total Event Count` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should standarize across assessments.
@mattroumaya This looks good so far. Added a bunch of minor comments, but not 100% sure about a few of the details. I want to think a bit more about the best way to define KRILabel and ScoreLabel as part of each assessment. I think I like the logic using lTags from your example above:
Not quite sure how this works right now looking at the code though ... I'm also debating if there's a compelling reason to bury these parameters in lTags instead of just defining them directly in the Also thinking ScoreLabel might just be hardcoded in the Analyze functions, while KRI label might be more variable (and thus defined as part of the assessment workflow. Long story short, we should probably find another 30 minutes to discuss. I'll try to block a time tomorrow. Thanks for getting the draft PR moving, it's definitely helping us get to the needed level of detail. |
@mattroumaya I just updated #462 and created #528 to outline my proposed approach. Feel free to add comments/questions in those issues. Or if the proposal in the issues is all fairly clear and makes sense to you feel free to try a draft implementation here. Consider all of my comments from the code review as loose suggestions and lower priority than the comments in the issues. |
Co-authored-by: Jeremy Wildfire <jwildfire@gmail.com>
Co-authored-by: Jeremy Wildfire <jwildfire@gmail.com>
Co-authored-by: Jeremy Wildfire <jwildfire@gmail.com>
Co-authored-by: Jeremy Wildfire <jwildfire@gmail.com>
Co-authored-by: Jeremy Wildfire <jwildfire@gmail.com>
Co-authored-by: Jeremy Wildfire <jwildfire@gmail.com>
Co-authored-by: Jeremy Wildfire <jwildfire@gmail.com>
@kodesiba - I hope this is now ready for you to branch off of to update qualification tests. Feel free to branch off and of course let me know if you have any questions. Still some updates needed for documentation and non-quali unit tests, but shouldn't affect your updates. |
rename( | ||
Residuals = .data$.resid, | ||
PredictedCount = .data$.fitted, | ||
mutate( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gwu05 Do we want to add a strScoreCol
parameter here? We can set default to ".resid", but could also allow users to set up assessments that use pvalue
(or another parameter) as the Score
column for use in flagging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's leave this hardcoded for now. Can revisit as needed if a new use case comes up.
R/Analyze_Identity.R
Outdated
#' | ||
#' @export | ||
|
||
Analyze_Identity <- function(dfTransformed, strValueCol = 'KRI', strLabelCol = "KRIColumn"){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add bQuiet just to be thorough. Will likely add some reporting in analyze functions in future releases.
@@ -27,18 +27,19 @@ | |||
#' @param dfInput A data.frame with one record per person. | |||
#' @param strCountCol Required. Numerical or logical. Column to be counted. | |||
#' @param strExposureCol Optional. Numerical `Exposure` column. | |||
#' @param strKRILabel Optional. Character vector to describe the `KRI` column. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make sense to have this optional? Does anything in StudyAssess break when KRILabel/ScoreLabel is missing.
I think I'd lean towards giving it a placeholder default like strKRILabel = "[Not Specified]"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one actually isn't optional - every *_Assess()
function has its own default strKRILabel
, so if not specified in a workflow mapping, Study_Assess()
will use the default for *_Assess()
.
Do you feel good about this setup? Or would you prefer putting a placeholder in Transform_EventCount()
(like above), and removing default strKRILabel
from Assess?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should do both. Pretty unlikely this will be called outside an _Assess
function, but would be good to have a reasonable default just in case.
@@ -0,0 +1,3 @@ | |||
test_that("multiplication works", { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reminder to update
@@ -65,10 +66,10 @@ test_that("incorrect lTags throw errors", { | |||
|
|||
# custom tests ------------------------------------------------------------ | |||
test_that("dfAnalyzed has appropriate model output regardless of statistical method", { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be worth adding a test to insure that Score/ScoreLabel populate as expected as well.
@@ -70,3 +71,8 @@ test_that("bReturnChecks works as intended", { | |||
"lChecks" %in% names(Consent_Assess(consentInput, bReturnChecks = TRUE)) | |||
) | |||
}) | |||
|
|||
test_that("strKRILabel works as intended", { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add test for Score/ScoreLabel
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
applies to all Assess functions
@mattroumaya Core structure looks good! Suggested lots of minor tweaks/cleanup in latest review. |
Co-authored-by: Jeremy Wildfire <jwildfire@gmail.com>
Co-authored-by: Jeremy Wildfire <jwildfire@gmail.com>
Co-authored-by: Jeremy Wildfire <jwildfire@gmail.com>
Co-authored-by: Jeremy Wildfire <jwildfire@gmail.com>
Co-authored-by: Jeremy Wildfire <jwildfire@gmail.com>
Co-authored-by: Jeremy Wildfire <jwildfire@gmail.com>
Co-authored-by: Jeremy Wildfire <jwildfire@gmail.com>
Co-authored-by: Jeremy Wildfire <jwildfire@gmail.com>
Merge branch 'dev' of github.com:Gilead-BioStats/gsm into fix-462 # Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit.
@kodesiba giving the go ahead to update qualification tests. I think everything else is covered. @jwildfire feel free to give this another review if you have the chance, or feel free to wait until Nathan's PR is merged. |
Merge branch 'dev' of github.com:Gilead-BioStats/gsm into fix-462 # Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit.
update qualification tests for KRI update
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
@mattroumaya Looks great. Will leave merge to you. |
Co-authored-by: Jeremy Wildfire <jwildfire@gmail.com>
Overview
Only ready for a preliminary review to make sure things are going as planned:
KRILabel
inStudy_Assess()
withae.yaml
KRILabel
vialTags
if running single assessment (see below)Test Notes/Sample Code