risk_ratio: Calculates the risk ratio (RR) and standard error.

View source: R/risk_ratio.R

risk_ratioR Documentation

Calculates the risk ratio (RR) and standard error.

Description

risk_ratio Calculates the risk ratio and standard error.

Usage

risk_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, list2milist or mids2milist.

Details

Note that the standard error of the RR is in fact the standard error of the (natural) risk ratio.

Value

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

Author(s)

Martijn Heymans, 2021

See Also

with.milist

Examples


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


miceafter documentation built on Oct. 2, 2022, 5:08 p.m.