codeScales: codeScales

Description Usage Arguments Value Examples

View source: R/qscales.R

Description

A function to compute the means for each participant in a certain questionnaire. Any questionnaire contains a table that indicates which items belong to which scale and which items are recoded. This table can be inserted into the function via the argument scales.

Usage

1
2
codeScales(data, scales, recode = TRUE, valid.values = NULL,
  return.both = FALSE)

Arguments

data

A data frame that contains only the values of the questionnaire.

scales

A character vector that indicates which items belong to which scale

recode

Logical. Should the values be recoded automatically? Default is to TRUE

valid.values

Vector of numeric values that are valid for the questionnaire, i. e. the numeric transformation of the likert scale.

return.both

Logical. Should the original data frame and the new scales be returned? Defaul is ti FALSE, which returnes only the scores scales.

Value

A data frame wich contains the scored scales of the questionnaire used.

Examples

1
2
3
4
5
6
7
scales <-  c("E = 1r, 6, 11R, 16",
             "A = 2r, 7, 12r, 17r",
             "C = 3, 8r, 13, 18",
             "N = 4, 9r, 14, 19",
             "O = 5, 10, 15, 20 21")
data <- bigfive[grep(x = names(bigfive), pattern = "BFI_")]
transformed.data <- codeScales(data, scales, recode = TRUE, return.both = FALSE)

kthorstmann/quest documentation built on May 20, 2019, 7:05 p.m.