HH (version 2.2-17)

as.likert: Support functions for diverging stacked barcharts for Likert, semantic differential, and rating scale data.

Description

Constructs class="likert" objects to be used by the plot.likert methods.

Usage

is.likert(x)

as.likert(x, ...)
## S3 method for class 'likert':
as.likert(x, ...)
## S3 method for class 'data.frame':
as.likert(x, ...)
## S3 method for class 'formula':
as.likert(x, ...)  ## doesn't work yet
## S3 method for class 'ftable':
as.likert(x, ...)
## S3 method for class 'table':
as.likert(x, ...)
## S3 method for class 'matrix':
as.likert(x, rowlabel=NULL, collabel=NULL, ...)
## S3 method for class 'numeric':
as.likert(x, ...)

as.MatrixList(x, ...)
## S3 method for class 'array':
as.MatrixList(x, ...)
is.likert.capable(x, ...)

Arguments

Value

For the as.likert methods, a likert object, which is a matrix with additional attributes that are needed to make the barchart method used by the plot.likert methods work with the data. Columns for respondents who disagree have negated values. The column of the original data for respondents who neither agree nor disagree is split into two columns, each containing halved values---one positive and one negative. Negative columns come first in the sequence of "No Opinion"(negative)--"Strongly Disagree", followed by "No Opinion"(positive)--"Strongly Agree". There are four attributes: "even.col" indicating whether there were originally an even number of columns, "n.levels" the original number of levels, "levels" the original levels in the original order, "positive.order" The sequence in which to display the rows in order to make the right hand sides progress with high values on top. is.likert returns a TRUE or FALSE value. is.likert.capable returns a TRUE or FALSE value if the argument can used as an argument to one of the plot.likert methods. The as.MatrixList methods construct a list of matrices from an array. Each matrix has the first two dimensions of the array. The result list is itself an array defined by all but the first two dimensions of the argument array.

Details

Please see likert for information on the plot for which as.likert prepares the data.

References

Naomi Robbins , "Visualizing Data: Challenges to Presentation of Quality Graphics---and Solutions", Amstat News, September 2011, 28--30. Naomi B. Robbins and Richard M. Heiberger (2011). Plotting Likert and Other Rating Scales. In JSM Proceedings, Section on Survey Research Methods. Alexandria, VA: American Statistical Association. Luo, Amy and Tim Keyes (2005). "Second Set of Results in from the Career Track Member Survey," Amstat News. Arlington, VA: American Statistical Association.

See Also

likert

Examples

Run this code
## Please see ?likert to see these functions used in context.

tmp2 <- array(1:12, dim=c(3,4), dimnames=list(B=LETTERS[3:5], C=letters[6:9]))
as.likert(tmp2)  ## even number of levels.

is.likert(tmp2)
is.likert(as.likert(tmp2))


tmp3 <- array(1:24, dim=c(2,3,4), dimnames=list(A=letters[1:2], B=LETTERS[3:5], C=letters[6:9]))
as.MatrixList(tmp3)
sapply(as.MatrixList(tmp3), as.likert, simplify=FALSE)  ## odd number of levels.

Run the code above in your browser using DataLab