recode: Recodes negatively worded items

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/recode.R

Description

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

Usage

1
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

Details

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

Value

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

Author(s)

L. A. van der Ark L.A.vanderArk@uva.nl

See Also

DS14, twoway

Examples

1
2
3
4
5
6
7
  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)

vandenman/mokken documentation built on April 12, 2020, 4:06 a.m.