plot.QmethodRes: Q Method: plot for statement z-scores

View source: R/plot.QmethodRes.R

plot.QmethodResR Documentation

Q Method: plot for statement z-scores

Description

Takes an object of class QmethodRes resulting from qmethod and makes a dot-chart with the z-scores for statements and all factors.

Usage

## S3 method for class 'QmethodRes'
plot(x, xlab = 'z-scores', ylab = 'statements', 
     pchlist = NULL, colours = NULL, 
     fnames = NULL, legend = TRUE,
     dist = TRUE, pchlist.fill = NULL,
     leg.pos="bottomright", xlim= NULL, 
     sort.items=T, factors = NULL,
     ...)

Arguments

x

results object returned by qmethod.

xlab

label for x axis. Defaults to 'z-scores'.

ylab

label for y axis. Defaults to 'statements'.

pchlist

array of pch symbols to be used in plotting the points for each factor. Defaults to a pre-defined set of symbols.

colours

array of colours to be used when plotting the points for each perspective. Defaults to a pre-defined set of colours based on the rainbow palette.

fnames

names for factors to be used in the legend. In results where factor names have not been changed (using, e.g. q.fnames) it defaults to 'Factor 1', 'Factor 2', etc.

legend

logical; if FALSE, no legend will be drawn.

dist

Logical. Should distinguishing statements be indicated in the plot dots? If TRUE, then the z-score values that are distinguishing for a given statement and factor are represented with a different (filled) symbol.

pchlist.fill

List of symbols to indicate distinguishing statements. By default, this is set to NULL, which provides a set of symbols that coincides with those in pchlist, but filled.

leg.pos

Position of the legend.

xlim

Limits for the x axis, given as a vector of two numbers. If this is not provided, the limits are calculated from the sample.

sort.items

Whether and how the items are sorted in the vertical axis. Defaults to TRUE, which sorts the items according to the standard deviation of their z-scores for all factors; items of most disagreement are placed at the top. To invert this order (items of most disagreement at the bottom), set this argument to "consensus.top" A value of FALSE will not sort the items, and these are displayed in the same order as in the raw data. A numerical vector can also be provided in order to sort the statements manually: the vector needs to have the same length as the number of items, and provides the order in which the items are to be ordered.

factors

The factors to plot. Defaults to NULL, which plots all the factors in the object x in the order given. To print a subset of these factors or to print them in a different order, provide a numeric vector here with the factors and the order desired, e.g. c(2,1)

.

...

other arguments for plot.

Note

The names of items to be plotted are taken from the matrix x$zsc.

To change these names, change the row names in that matrix first, e.g.: rownames(x$zsc) <- vector.of.item.names.

If the margin width is not enough to read the items, specify par(mai=...) first. See par for details.

Author(s)

Aiora Zabala

References

This specific dotchart visualisation of Q results implemented in plot.QmethodRes was first developed and introduced in this R package, in preparation for the study published in Zabala et al. (2017).

See Also

dotchart and points.

Examples

data(lipset)
results <- qmethod(lipset[[1]], nfactors = 3, rotation = "varimax")
title <- "Q method z-scores, lipset dataset"
subtitle <- paste0("Three factors, PCA, varimax. Printed on ",
                  Sys.Date())
plot(results, main = title, sub = subtitle)

# Order the items in a different way
plot(results, main = title, sub = subtitle, 
     sort.items = c(rev(1:nrow(results$zsc))))

aiorazabala/qmethod documentation built on Nov. 23, 2023, 1:25 a.m.