reverse_score: Reverse Score Survey Item

View source: R/reverse_score.R

reverse_scoreR Documentation

Reverse Score Survey Item

Description

Calculates the reverse scoring of a standard survey item. You must specify the maximum value of the survey item if the values are all postive (e.g. 7 on a 1 to 7 scale). You may also specify if a scale's range include negative values that straddle zero (e.g. -5 to 5 scales).

Usage

reverse_score(x, xmax, negvals = FALSE)

Arguments

x

numeric vector

xmax

maximum value of scale item

negvals

logical indicating if the scale contain negative values

Author(s)

Robert S. Chavez

Examples

x <- sample(1:7, 10, replace = TRUE)
reverse_score(x, 7)

y <- sample(-5:5, 10, replace = TRUE)
reverse_score(y, negvals = TRUE)

chavezlab/csnl documentation built on June 12, 2022, 10:09 a.m.