Description Usage Arguments Details Value Examples
Compute the consensus for all items of a data frame, based on Tastle & Wiermann, (2006).
1 2 |
range |
The range of the items indicating the valid values. Default is |
consensus.only |
Logical, if only the consensus should be reported. Default is to |
round |
The number of digits to round the result to. Default is to 2. |
check.int |
Whether the function should check for integers. Default is to |
item |
The dataframe with the items, for which the conensus should be computed. |
The number of valid answers on that item
The minimum answer on that item
The maximum answer on that item
The consensus
The dissensus
The absolute number of missing values on that item, defined as NA
The relative number of missing values on that item, defined as NA
Returns an data frame with the consensus and additional information for each item. See details for further explanation.
1 2 3 4 5 6 7 8 9 10 11 | n = 10 # (max = 26 for now)
var_names <- paste0("var_", letters[1:10])
entries <- matrix(sample(-2:2, n*10, replace = TRUE),
nrow = n, ncol = 10)
entries[sample(1:100, 15)] <- NA
data <- as.data.frame(entries)
colnames(data) <- var_names
subj_id <- paste0("id_", sample(letters, n, replace = FALSE))
data <- cbind(subj_id, data, stringsAsFactors = FALSE)
data["var_j"] <- data["var_j"] / 2.3
consensus_df(data, range = c(-2, 2), check.int = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.