Learn R Programming

Scale (version 1.0.4)

Scale: Define Data Set, Reverse Items and Alternate Orders

Description

Construct a ScaleData object, in order to hold data, item content, administration order(s), reverse items and item column names.

Usage

Scale(data, orders, orders_id, reverse, items, col_names)

Arguments

data
A data.frame with participants as rows and items as columns.
orders
A list of the various orders used for reordering the questionnaire administration, if any. Each order is an integer vector.
orders_id
An integer vector identifying which order of the questionnaire each participant received.
reverse
In the original order, which of the items need to be reversed.
items
An optional character vector containing the item statements.
col_names
An optional character vector of the desired column names of the items, in the original order.

Value

A ScaleData object, with the above arguments named, in order to be passed on to the PreProc() function.

Examples

Run this code
data(Depression98)
depressionScale <- Scale(data=Depression98, 
                          orders=list(
                            c(16,19,11,9,1,17,5,18,4,8,2,12,
                              20,10,14,6,3,13,15,7),
                            c(1,18,4,15,7,8,3,14,20,6,19,16,
                            12,5,10,13,2,17,11,9)),
                            orders_id=c(
                                        rep(1, 49),
                                        rep(2, 49)),
                            reverse=c(3,4,13,14,18,20),
                            col_names= paste('q', 1:20, sep=''))
str(depressionScale)

Run the code above in your browser using DataLab