-
Notifications
You must be signed in to change notification settings - Fork 4
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
Make create_cat_var & create_subgrps more general #55
Comments
Hello, |
Ah, interesting. I hadn't thought to try using any other numbers. Apologies for my confusion. I think in general having more examples in the documentation would be helpful. Also, this may not be the right thread but how do you calculate BMI using metacore/metatools from Height and Weight? I'm just wondering what the correct way is to define derivations that's not simply grabbing a predecessor variable or mapping numeric ranges to categories. The broader question I'm struggling with is whether I can use metacore/metatools to fully handle creating ADaMs from SDTMs. Additionally, admiral appears to be leading the way towards being the industry standard for deriving variables; how can metacore be combined with admiral? In addition to the code_decode column in codelist, could we have a code option which then triggers some custom code, perhaps using admiral, to be run to derive a variable? Not sure if this is doable currently or otherwise not advised. |
Fair question, {metatools} isn't built to be a stand alone tool, it is meant to be used in conjunction with things like admiral. The problem I ran into when looking to automate stuff is there isn't enough consistency in how things are defined across companies to be able to build automation off the back of them. That is why I just stick to the predecessors. But, that doesn't mean you couldn't develop a package for your company that reflect how your company defines things. |
Gotcha. I think I just found a project to carve out :) hopefully I can open source / turn the learnings into a talk next year. I guess there's a spectrum of options to define custom derivations. The (seemingly) most flexible way is to allow for R code to be defined in the codelist. For example, you could have a BMI variable which is defined as One potential issue I foresee is updating the base metacore class so the codelist table can handle a format, say, other than a code/decode tibble in the code column. I'm just not sure if this is allowed currently or if it's better to create a subclass that extends the attributes of codelist. |
You can define R code in the derivation table. You would just need to define it in such away that you could programmatically identify it as R code. This shouldn't be done in the code list but instead leveraging the derivations, which is how the predecessors are handled |
Do you have an example of this? I'm exploring some of the sample files in the inst/extdata directory of {metacore} but I haven't come across an example as you describe. When looking at the derivations table, the derivation column appears to mostly be descriptions and sometimes looks like a direct mapping of a predecessor variable. Is this where R code should go? |
I don't have an example of it, but it is a free text field so you can put what you want into the derivation column of the derivation table |
Gotcha, thanks! So I went through an example of how it could be done. Here goes:
|
@daniel-woodie as FYI we now have an examples site showing some implementation examples of using the various packages together: https://pharmaverse.github.io/examples/adam/adsl.html. Look forward to hearing more on how you get on with the metadata-driven automation approach for ADaM using these packages. Maybe you might like to share a demo at one of our quarterly admiral community meetings sometime? Tagging @manciniedoardo who organises these. |
Thanks for adding me in the loop @rossfarrugia, @daniel-woodie please feel free to reach out if you want a slot! Next one is currently planned for 9th May. |
@manciniedoardo @rossfarrugia I'm in. We've worked some with Appsilon on a package extension to handle more complex derivations with {admiral}. We'll work to open source that in the next few weeks and can do a walk through at the next admiral community meeting. Interested in hearing feedback (thanks @kaz462 for connecting the dots here). |
@daniel-woodie please do keep us in the loop. Look forward to hearing more and once open source we can discuss whether this extension should be put forward to pharmaverse too! |
Great! I'll be in touch 😄 |
@daniel-woodie I've sent you a message on Slack to connect re the community meeting :) |
Hi @daniel-woodie - just checking you saw my slack message? Would love to feature you in our community meeting! |
Currently create_cat_var calls create_subgrps to assign groups based on age ranges. My suggestion is to change the naming of the functions to more accurately represent what they do. Perhaps just create_age_grps or something like that. I found create_cat_var to be confusing in that it really only supports creating categories based on age ranges. Another fix could be expanding the code/decode options to account for the filtering itself.
The text was updated successfully, but these errors were encountered: