bws.count {support.BWS} | R Documentation |
Calculating count-based BW scores
Description
This function calculates various BW scores on the basis of a counting approach.
Usage
bws.count(data, cl = 1)
## S3 method for class 'bws.count'
print(x, digits = max(3, getOption("digits") - 3), scientific = FALSE, ...)
## S3 method for class 'bws.count2'
plot(x, score = c("bw", "b", "w"), pos = 1, xlab = NULL, ylab = NULL, subset, ...)
## S3 method for class 'bws.count2'
barplot(height, score = c("bw", "b", "w", "sbw"), mfrow = NULL, mean = FALSE,
error.bar = NULL, conf.level = 0.95, subset, sort = FALSE, ...)
## S3 method for class 'bws.count2'
sum(x, ...)
## S3 method for class 'bws.count2'
mean(x, ...)
## S3 method for class 'bws.count2'
summary(object, sort = FALSE, subset, ...)
## S3 method for class 'summary.bws.count2'
print(x, digits = max(3, getOption("digits") - 3), scientific = FALSE, ...)
Arguments
data |
A data frame containing the output from |
cl |
A value describing the S3 class of the object created by this function: |
x , height , object |
An object of the S3 class |
digits |
The number of significant digits. See the |
scientific |
Scores are encoded in scientific format. See the |
score |
A character showing a type of the output from this function: |
pos |
A value showing a position of labels for points in the plot. See the argument |
xlab |
A character showing a label for the x axis. |
ylab |
A character showing a label for the y axis. |
mfrow |
A two-element vector |
mean |
A logical value denoted by |
error.bar |
A character shoiwng a type of error bar adding on the bar plot of the aggregated standardized BW scores: |
conf.level |
A value showing the confidence level when adding the confidence interval on the bar plot using |
subset |
A logical expression indicating a subset of observations to be used. |
sort |
A logical value denoted by |
... |
Arguments passed to a function used internally. |
Details
This function calculates various BW scores on the basis of the counting approach. For details on the scores, refer to support.BWS-package
.
When using this function with the argument cl = 1
, it returns an object of the S3 class "bws.count"
, containing disaggregated scores and aggregated scores in list format. The first category includes disaggregated best (B), worst (W), best-minus-worst (BW), and standardized BW scoers. The second category includes aggregated B, W, BW, and standardized BW scores as well as the square root of the ratio of the aggregated B to the aggregated W and its standardized scores. The generic function print()
is available for the S3 class "bws.count"
. The print()
shows a summary of disaggregated scores and a table of aggregated scores.
When using this function with the argument cl = 2
, it returns an object of the S3 class "bws.count2"
, which inherits from the S3 class "data.frame"
, including disaggregated B, W, BW, and standardized BW scores, respondent identification number variable, and respondent characteristic variables. The generic functions such as plot()
, barplot()
, sum()
, mean()
, and summary()
are available for the S3 class "bws.count2"
. The plot()
draws the relationship between means and standard deviations of B, W, or BW scores. The barplot()
draws the bar plot of the aggregated standardized BW scores or the bar plots of B, W, or BW scores. The sum()
returns the aggregated B, W, and BW scores in data frame format. The mean()
returns means of B, W, BW, and standardized BW scores in data frame format. The summary()
calculates (1) aggregated B, W, BW, and standardized BW scores, (2) item ranks based on the BW score, (3) means of B, W, BW, and standardized BW scores, and (4) the square root of the aggregated B to the aggregated W and its standardized scores.
Value
The output from bws.count()
with the argument cl = 1
is an object of the S3 class "bws.count"
, containing three components:
A list disaggregate
contains five objects related to disaggregated scores.
ID |
A vector showing the respondent's identification number. |
B |
A matrix showing the number of times item |
W |
A matrix showing the number of times item |
BW |
A matrix showing the difference between |
stdBW |
A matrix showing standardized |
A data frame aggregate
contains aggregated scores across all respondents.
B |
A variable showing the number of times item |
W |
A variable showing the number of times item |
BW |
A variable showing the difference between |
stdBW |
A variable showing standardized |
sqrtBW |
A variable showing the square root of the ratio of |
std.sqrtBW |
A variable showing the standardized |
A list information
contains basic information related to the BWS questions.
nrespondents |
A variable showing the number of respondents. |
nitems |
A variable showing the number of items. |
fitem |
A variable showing the frequency of each item in the choice sets. |
vnames |
A variable showing the names of each item. |
The output from bws.count()
with the argument cl = 2
, which is an object of the S3 class "bws.count2"
, is a data frame containing respondent identification number variable, B score variables, W score variables, BW score variables, standardized BW score variables, and respondent characteristic variables. These scores are calculated by each respondent.
Note that the S3 class "bws.count"
would be replaced by the S3 class "bws.count2"
in future.
Author(s)
Hideo Aizaki
See Also
support.BWS-package
, bws.dataset
Examples
## See examples in bws.dataset()