-
Notifications
You must be signed in to change notification settings - Fork 53
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
Enhancing derive_var_trtemfl()
to deal with AEs recorded on multiple lines
#2302
Comments
Hi @ashachakma - how is this one going? any questions? Do you think you will be able to finish before our "other works" gets busy or do you want to hold off until afterwards? |
@ashachakma @bms63 thanks for picking up this issue and following up
|
I like this idea as it doesn't impact the function's original purpose. Do you mind putting on the agenda for Wednesday and we can make final decision? Others please add thoughts too!! |
Hi Ben, this is my first time working on a function enhancement so, I might take some time to finish it. Till now, I looked into the document and, trying to understand how the function is working. My study has SAC work from next week so, I will try to finish it by this week else I will continue after my study work finishes. |
Awesome!! It is a good one for you. We can help - so don't hesitate on asking questions!! |
Sure Ben, thanks. As I progress I will have more questions, for now, @gg106046 is helping me with the basic ones. |
Hi @manciniedoardo @kaz462 @bms63 , can you provide me with an example of how the AEITOXGR will look if the grouping variable is present in the AE data? The above example shows without AEITOXGR, it's quite puzzling how to consider the worsening condition if both AEITOXGR and AETOXGR are present. Thanks! |
Is my understanding correct?- once a record within a grouped AE is flagged as a TEAE within the window, then any subsequent record should also be a TEAE regardless of the severity and when it starts relative to the window. |
@kaz462 I have not heard any grumblings about this enhancement - so I think we can go ahead with your proposal. Is it possible to supply Asha with some additional examples? |
@ashachakma thanks for looking into it! Your understanding is correct, we assign Example with AEITOXGR added: # A tibble: 6 × 10
USUBJID AEGRPID ASEQ AETERM ASTDT TRTSDT TRTEDT AETOXGR TRTEMFL AEITOXGR
<chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
1 ABC-1 1 1 Headache 2020-01-01 2020-01-05 2020-03-05 2 NA 2
2 ABC-1 1 2 Headache 2020-01-15 2020-01-05 2020-03-05 1 NA 2
3 ABC-1 1 3 Headache 2020-02-15 2020-01-05 2020-03-05 2 Y 2
4 ABC-1 2 4 Fever 2020-01-01 2020-01-05 2020-03-05 2 NA 2
5 ABC-1 2 5 Fever 2020-01-15 2020-01-05 2020-03-05 3 Y 2
6 ABC-1 2 6 Fever 2020-02-15 2020-01-05 2020-03-05 1 Y 2 I summarized our internal spec into the following workflow, do you think we can apply it when enhance this function? flowchart TB
AEITOXGR["AEITOXGR"] -->|"missing AEITOXGR: \n AE not exist before TRTSDT"| arise1["New AE records \n within TEAE window"] --> |New|TEAE[Step 3: Flag records identified above as TEAE]
AEITOXGR -->|"non-missing AEITOXGR: \n AE exist before TRTSDT"|Worsen1["Step 1: Identify worsened records \n (compare with the previous record) \nafter TRTSDT"]--> Worsen2["Step 2: Get the first worsen date \n after TRTSDT"]-->worsen3["All records after \n the 1st worsen date \n and within TEAE window"]--> |Worsen|TEAE
style TEAE fill:#b3ffb3,stroke:#4CAF50,stroke-width:2px
style Worsen1 fill:#b3ffb3,stroke:#4CAF50,stroke-width:2px
style Worsen2 fill:#b3ffb3,stroke:#4CAF50,stroke-width:2px
|
Hi @kaz462, thanks for your response and the flowchart, this is very helpful. Yeah, I think this can be applied while enhancing the function. Thanks! |
@ashachakma I am able to rebuild the site from your branch |
@bms63 nope, we discussed it a little bit on Slack, but those solution didn't work either. It's interesting that it works on your end. It looks like the problem is on our end, not the branch. I removed it a few times and downloaded everything from scratch, but no luck. I'll do it again. Can it be R version issue? My R is 4.2.1 |
Can you do a session info dump here please. @ashachakma be nice for you to do as well |
|
|
I have the same situation as #2350 .Rmd file do not have analysis_var but I see this parameter in .R file. |
I restarted my laptop and tried again running pkgdown::build_site(), it ran successfully :) but other checks are failing so, checking those issues now. |
derive_var_trtemfl()
to deal with AEs recorded on multiple liesderive_var_trtemfl()
to deal with AEs recorded on multiple lines
…re created using `get_new_tmp_var()`, other changes updated suggested in the review comment
* #2302 New argument, group_var added * #2302 Fixed spelcheck and styler error * #2302 Fixed lintr and roxygen related issues * #2302 Fixed styler issue * #2302 Updated new global variables, added `lag()` in NAMESPACE * #2302 Fixed lintr and styler issue * #2302 Fixed issue related to roxygen check * #2302 header updated with group_var details and temporary variables are created using `get_new_tmp_var()`, other changes updated suggested in the review comment * Update R/derive_var_trtemfl.R Co-authored-by: Stefan Bundfuss <80953585+bundfussr@users.noreply.github.com> * Update R/derive_var_trtemfl.R Co-authored-by: Stefan Bundfuss <80953585+bundfussr@users.noreply.github.com> * Update R/derive_var_trtemfl.R Co-authored-by: Stefan Bundfuss <80953585+bundfussr@users.noreply.github.com> * Update R/derive_var_trtemfl.R Co-authored-by: Stefan Bundfuss <80953585+bundfussr@users.noreply.github.com> * #2302: add subject_keys, update check for initial_intensity * #2302: update new AE derivation/get_new_tmp_var * #2302: devtools::document() * #2302: upversion roxygen2 * #2302: update group_var/subject_key description, check, and example * #2302 enhance_derive_var_trtemfl: update subject_keys argument * #2302 enhance_derive_var_trtemfl: fix example --------- Co-authored-by: Jerry Johnson <jerry@gmail.com> Co-authored-by: Ben Straub <ben.x.straub@gsk.com> Co-authored-by: Kangjie Zhang <47867131+kaz462@users.noreply.github.com> Co-authored-by: Stefan Bundfuss <80953585+bundfussr@users.noreply.github.com> Co-authored-by: Kangjie Zhang <kangjie.zhang@bayer.com> Co-authored-by: Stefan Bundfuss <stefan.bundfuss@roche.com>
Background Information
(Courtesy of @kaz462)
Currently, derive_var_trtemfl derives TEAE flag with the assumption that AEs are recorded as a single line for each event (one record in the database). But some studies record one episode of AE with multiple lines using a grouping variable - could we take the grouping variable into consideration when AE data is collected this way e.g., the following subject ABC-1 has two episodes of AE:
Some other examples with a grouping variable:
Definition of Done
derive_var_trtemfl()
enhanced to deal with these cases also, without breaking backwards compatibility.The text was updated successfully, but these errors were encountered: