Learn R Programming

mokken (version 3.0.4)

recode: Recodes negatively worded items

Description

Returns a matrix or data.frame with the indicated items recoded.

Usage

recode(X, items = NULL, values = defaultValues)

Arguments

X

matrix or data frame of numeric data containing the responses of nrow(X) respondents to ncol(X) items. Missing values are allowed

items

Vector of integers indicating the items to be recoded

values

Vector of possible item scores. By default the range of the observed values is taken

Value

The result is X for which columns items have been recoded.

Details

The result is X for which columns items have been recoded.

See Also

DS14, twoway

Examples

Run this code
# NOT RUN {
  data(DS14)
  
  # Handle missing data and recode negatively worded items
  X <- DS14[, 3 : 16]
  X <- twoway(X)
  X <- recode(X, c(1, 3))
  head(X)
# }

Run the code above in your browser using DataLab