Learn R Programming

miceafter (version 0.5.0)

propdiff_ac: 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)

Value

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

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.

Author

Martijn Heymans, 2021

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.

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

Run this code

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))

Run the code above in your browser using DataLab