remove_outliers_REI: Remove outliers and calculate REI

View source: R/utils.R

remove_outliers_REIR Documentation

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

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

Value

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

Examples


df <- data.frame(var1 = c(1, 2, 3), var2 = c(2, 3, 4))
result <- remove_outliers_REI(df, TRUE, "var1,var2", c(1, 5))


colleyRstats documentation built on May 3, 2026, 5:07 p.m.