get_results_dataframe function

Take predicted dataframe and calculate the outcome (risk difference/ratio, incidence rate difference/ratio, mean difference, and/or number needed to treat)

Take predicted dataframe and calculate the outcome (risk difference/ratio, incidence rate difference/ratio, mean difference, and/or number needed to treat)

get_results_dataframe(predict.df, outcome.type)

Arguments

  • predict.df: (Required) A data.frame output from the make_predict_df function with predicted outcome for each observation at each level of treatment/exposure.

  • outcome.type: (Required) Character argument to describe the outcome type. Acceptable responses, and the corresponding error distribution and link function used in the glm, include:

    • binary: (Default) A binomial distribution with link = 'logit' is used.
    • count: A Poisson distribution with link = 'log' is used.
    • count_nb: A negative binomial model with link = 'log' is used, where the theta parameter is estimated internally; ideal for over-dispersed count data.
    • rate: A Poisson distribution with link = 'log' is used; ideal for events/person-time outcomes.
    • rate_nb: A negative binomial model with link = 'log' is used, where the theta parameter is estimated internally; ideal for over-dispersed events/person-time outcomes.
    • continuous: A gaussian distribution with link = 'identity' is used.

Returns

A list containing the calculated results for the applicable measures (based on the outcome.type): Risk Difference, Risk Ratio, Odds Ratio, Incidence Risk Difference, Incidence Risk Ratio, Mean Difference, Number Needed to Treat, Average Tx (average predicted outcome of all observations with treatment/exposure), and Average noTx (average predicted outcome of all observations without treatment/exposure)

  • Maintainer: Jessica Grembi
  • License: GPL-3
  • Last published: 2022-05-31

Useful links