| remove_outliers_REI | R Documentation |
This function takes a data frame, optional header information, variables to consider, and a range for a Likert scale. It then calculates the Response Entropy Index (REI) and flags suspicious entries based on percentiles.
remove_outliers_REI(df, header = FALSE, variables = "", range = c(1, 5))
df |
Data frame containing the data. |
header |
Logical indicating if the data frame has a header. Defaults to FALSE. |
variables |
Character string specifying which variables to consider, separated by commas. |
range |
Numeric vector specifying the range of the Likert scale. Defaults to c(1, 5). |
For more information on the REI method, refer to: Response Entropy Index Method
A data frame with calculated REI, percentile, and a 'Suspicious' flag.
df <- data.frame(var1 = c(1, 2, 3), var2 = c(2, 3, 4))
result <- remove_outliers_REI(df, TRUE, "var1,var2", c(1, 5))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.