odds_ratio function

Calculates the odds ratio (OR) and standard error.

Calculates the odds ratio (OR) and standard error.

odds_ratio Calculates the odds ratio and standard error and degrees of freedom to be used in function with.milist.

odds_ratio(y, x, formula, data)

Arguments

  • y: 0-1 binary response variable.
  • x: 0-1 binary independent variable.
  • formula: A formula object to specify the model as normally used by glm.
  • data: An objects of class milist, created by df2milist, df2milist or mids2milist.

Returns

The odds ratio, related standard error and complete data degrees of freedom (dfcom) as n-2.

Details

Note that the standard error of the OR is in fact the standard error of the (natural) log odds ratio.

Examples

imp_dat <- df2milist(lbpmilr, impvar="Impnr") ra <- with(imp_dat, expr=odds_ratio(Chronic ~ Radiation))

See Also

with.milist, pool_odds_ratio

Author(s)

Martijn Heymans, 2021

  • Maintainer: Martijn Heymans
  • License: GPL (>= 2)
  • Last published: 2022-10-02