Learn R Programming

colleyRstats (version 0.0.1)

remove_outliers_REI: Remove outliers and calculate REI

Description

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.

Usage

remove_outliers_REI(df, header = FALSE, variables = "", range = c(1, 5))

Value

A data frame with calculated REI, percentile, and a 'Suspicious' flag.

Arguments

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

Details

For more information on the REI method, refer to: Response Entropy Index Method

Examples

Run this code
# \donttest{
df <- data.frame(var1 = c(1, 2, 3), var2 = c(2, 3, 4))
result <- remove_outliers_REI(df, TRUE, "var1,var2", c(1, 5))
# }

Run the code above in your browser using DataLab