Learn R Programming

support.BWS2 (version 0.1-0)

bws2.count: 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, ...)
"barplot"(height, score = c("bw", "b", "w"), output = c("level", "attribute"), mfrow = NULL, ...)
"sum"(x, output = c("level", "attribute"), ...)

Arguments

data
A data frame containing the dataset generated from bws2.dataset() with argument type = "marginal".
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.

Value

The output from bws2.count(), which is the object of the S3 class ‘bws2.count’, is a data frame containing five types of variables: respondent's identification variable, B score variables, W score variables, BW score variables, and standardized BW score variables. These scores are calculated by each respondent. The names of these score variables are b., w., bw., and sbw.. Part 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: The output has the following attributes:

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".

See Also

support.BWS2-package, bws2.dataset

Examples

Run this code
## See examples in bws2.dataset()

Run the code above in your browser using DataLab