propdiff_ac: Calculates the difference between proportions and standard...

View source: R/propdiff_ac.R

propdiff_acR Documentation

Calculates the difference between proportions and standard error according to method Agresti-Caffo

Description

propdiff_ac Calculates the difference between proportions and standard error according to method Agresti-Caffo.

Usage

propdiff_ac(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

As output the differences between proportions according to Agresti-Caffo and Wald are provided. The Agresti-Caffo difference is used in the function pool_propdiff_ac to derive the Agresti-Caffo confidence intervals. For the pooled difference between proportions the difference between proportions according to Wald are used.

Value

The difference between proportions, the standard error according to Agresti-Caffo and complete data degrees of freedom (dfcom) as n-1.

Author(s)

Martijn Heymans, 2021

References

Agresti, A. and Caffo, B. Simple and Effective Confidence Intervals for Proportions and Differences of Proportions Result from Adding Two Successes and Two Failures. The American Statistician. 2000;54:280-288.

Fagerland MW, Lydersen S, Laake P. Recommended confidence intervals for two independent binomial proportions. Stat Methods Med Res. 2015 Apr;24(2):224-54.

See Also

with.milist, pool_propdiff_ac

Examples


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

# same as
ra <- with(imp_dat, expr=propdiff_ac(y=Chronic, x=Radiation))


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