You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes it will jsut be easier to calculate the quantity you need rather than wrapping it up in a function and processing it through existing ard_*() functions. In the example below, we're taking a pre-calculated dispersion statistic from a negative binomial regression model and adding it to an ARD.
Would this be helpful?
Something like this?
devtools::load_all("/Users/sjobergd/Documents/GitHub/cards")
#> ℹ Loading cardsard_literal<-function(stats, variable, context="literal") {
# check inputs ---------------------------------------------------------------
set_cli_abort_call()
check_named_list_and_vector_elements(stats)
check_string(variable)
check_string(context)
# build data frame for calculaton --------------------------------------------dplyr::tibble("{variable}":=TRUE) |>
ard_continuous(
variables= all_of(variable),
statistic= everything() ~list(identity= \(x) stats)
) |>dplyr::mutate(
context=.env$context
)
}
ard_literal(list(dispersion=1.1), variable="age", context="negative binomial regression")
#> {cards} data frame: 1 x 8#> variable context stat_name stat_label stat fmt_fn#> 1 age negative… dispersion dispersi… 1.1 1#> ℹ 2 more variables: warning, error
I think this can be useful for tests. I do not know if users will be adopting it though, also because it applies only to one variable (no groups right?)
I think this can be useful for tests. I do not know if users will be adopting it though, also because it applies only to one variable (no groups right?)
We could add groups to the inputs, but if the results are pre-calculated I imagined grouping wouldn't be necessary...I can't think of a use case
Sometimes it will jsut be easier to calculate the quantity you need rather than wrapping it up in a function and processing it through existing
ard_*()
functions. In the example below, we're taking a pre-calculated dispersion statistic from a negative binomial regression model and adding it to an ARD.Would this be helpful?
Something like this?
Created on 2025-01-22 with reprex v2.1.1
The text was updated successfully, but these errors were encountered: