bws2.count: Calculating count-based best-worst scaling scores

bws2.countR Documentation

Calculating count-based best–worst scaling scores

Description

This function calculates best, worst, best-minus-worst, and standardized best-minus-worst scores for each respondent.

Usage

bws2.count(data, ...)

## S3 method for class 'bws2.count'
barplot(height, score = c("bw", "b", "w"), 
  output = c("level", "attribute"), mfrow = NULL, ...)

## S3 method for class 'bws2.count'
sum(x, output = c("level", "attribute"), ...)

Arguments

data

A data frame containing the dataset generated from bws2.dataset().

x, height

An object of the S3 class ‘bws2.count’.

output

A character showing a type of BWS score calculated by this function: "attribute" is assigned to this argument when BWS scores for attributes are calculated or "level" is assigned when BWS scores for attribute levels are calculated.

score

A character showing a type of the output from this function: "b" is assigned to this argument when the output is based on best scores, "w" is assigned when it is based on worst scores, or "bw" is assigned when it is based on best-minus-worst scores.

mfrow

A two-element vector c(nr, nc); bar plots will be drawn in an nr-by-nc array on the device by row.

...

Arguments passed to function(s) used internally.

Details

The bws2.count() function calculates disaggregated best (B), worst (W), best-minus-worst (BW), and standardized BW scores. For details on these scores, refer to the Details section on the help page of this package.

Output from this function is the object of S3 class ‘bws2.count’, which inherits from the S3 class ‘data.frame’. The generic functions such as barplot() and sum() are available for the S3 class ‘bws2.count’. The barplot() function draws the bar plots of B, W, or BW scores for each attribute when output = "attribute" or those for each attribute level when output = "level". The sum function returns a data frame containing B, W, BW, and standardized BW scores for all respondents for each attribute when output = "attribute" or for each attribute level when output = "level".

Value

The output from bws2.count(), which is the object of the S3 class ‘bws2.count’, is a data frame containing six types of variables: respondent's identification variable, B score variables, W score variables, BW score variables, standardized BW score variables, and respondent's characteristic variables. These scores are calculated by each respondent. The names of these score variables are b.<name of attribute or attribute level>, w.<name of attribute or attribute level>, bw.<name of attribute or attribute level>, and sbw.<name of attribute or attribute level>. Part <name of attribute or attribute level> for each score variable is set according to the argument attribute.levels in bws2.dataset() used to generate a dataset for bws2.count().

The output has the following attributes:

nquestions

A vector showing the number of questions.

nrespondents

A vector showing the number of respondents.

freq.levels

A variable showing the frequency of each attribute level in the choice sets.

attribute.levels

A list of attributes and their levels, which is the same as those assigned to argument attribute.levels in bws2.dataset() used to generate a dataset assigned to argument data of bws2.count().

vnames

A variable showing the names of each attribute level.

b.names

A variable showing the names of B score by each attribute level.

w.names

A variable showing the names of W score by each attribute level.

bw.names

A variable showing the names of BW score by each attribute level.

sbw.names

A variable showing the names of standardized BW score by each attribute level.

Author(s)

Hideo Aizaki

See Also

support.BWS2-package, bws2.dataset

Examples

## See examples in bws2.dataset()

support.BWS2 documentation built on May 24, 2022, 5:07 p.m.