Skip to content

Feature Request: ard_summary but for hierarchies #539

@kieranjmartin

Description

@kieranjmartin

What's the feature?

At the moment, ard_summary performs some function in every possible subgroup of each by variable or in every subgroup with observations in strata.

However, what it cannot mimic is the hierarchical behaviour, where we have every combination of a plausible subgroup, where each variable represents a level of hierarchy, which is what we need for AEs. Unfortunately, at the moment ard_hierarchical is hard wired to tabulate: calculate N.

I have come across at least one situation where this would be useful: Exposure-adjusted incidence rate (EAIR) requires calculating total patient time at risk, which is dependent on the sub category you are calculating for. So for covid I need to know when those patients experienced their first covid exposure, and then calculate the risk from the remainder of the data.

Now technically I could use mvr_summary here, but the total size of the by combinations (most of which are nonsensical) means that R actually doesn't even get to any calculations; it hangs generating all of the possible combinations!

I think the best solution is something like ard_hierarchical_summary to allow for this situation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions