Description Usage Arguments Value Examples
Returns a list containing the confusion table, the two proportions, and the difference in the proportions with a confidence interval
1 | ff_proptest(var, byvar, data = dt, dp = 1)
|
var |
a binary variable |
byvar |
a stratifying binary variable |
data |
a data frame (or data.table) |
dp |
number of decimal places in formatted response |
a table and a series of strings formatted for a scientific paper
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | # Create data.frame and summarise proportion of A's and B's
set.seed(1)
dd <- data.frame(
X=sample(c(0,1), 100, replace=TRUE),
strata=sample(c("A", "B"), 100, replace=TRUE))
with(dd, table(strata, X))
ff_proptest(X, strata, data=dd)
# $table
# 0 1
# A 23 23
# B 29 25
# $est1
# [1] "50.0%"
# $est2
# [1] "53.7%"
# $d
# [1] "3.7%"
# $ci
# [1] "17.9% to 25.4%"
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.