prop_agree | R Documentation |
get (proportion) percentage agreement of answers in a vector - 'agreement' to be defined by cutoff
prop_agree(x, cutoff = 1, restrict_level = NULL)
x |
a numeric vector |
cutoff |
a vector defining positive answers, default = 1 in a binary dataset |
restrict_level |
the minimum number of valid answers needed to display result, otherwise the answer is restricted and set to NA, default is NULL (no restriction) |
a numeric value between 0 - 1
# binary vector
vec <- c(0, 1, 1, 0, 0, 1, NA_real_, 1)
prop_agree(x = vec, cutoff = 1)
# with restriction - throws NA as not applicable
prop_agree(x = vec, cutoff = 1, restrict_level = 8)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.