Skip to content

For Discussion: Function to extract statistics from ARD #452

Description

@ddsjoberg

I see two kinds of functions.

  1. The first to simply grab a statistic from an ARD. This is perhaps already covered by the get_ard_statistics() function.

Image

  1. The second would do a bit more because it would also format the statistics and have the ability to return stats in a string. For example, if a user wanted the statistics above, and wanted them returned with Ns and percentages, they could include an argument like foo(ard, pattern = "{n} / {N} ({p}%)"). The function would apply the formatting function it the ARD to get the stat_fmt column, then using glue, inject for formatted statistics in to a string, e.g. "42 / 86 (49%)". This could be massively helpful for medical writers. They could get an LLM to summarize a table/figure by passing it the JSON representation of the ARD (the LLMs are already good at this). Then request that the LLM replace and statistics with calls to this function so the numbers will dynamically update as more data comes in.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions