Type: | Package |
Title: | R Commander Plug-in for Case 3 Best-Worst Scaling |
Version: | 0.3-1 |
Date: | 2025-06-14 |
Depends: | support.BWS3, support.CEs, survival |
Imports: | Rcmdr |
Description: | Adds menu items for case 3 (multi-profile) best-worst scaling (BWS3) to the R Commander. BWS3 is a question-based survey method that designs various combinations of attribute levels (profiles), asks respondents to select the best and worst profiles in each choice set, and then measures preferences for the attribute levels by analyzing the responses. For details on BWS3, refer to Louviere et al. (2015) <doi:10.1017/CBO9781107337855>. |
License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
URL: | https://sites.google.com/view/r4sp/rcmdrplugin |
RcmdrModels: | clogit |
NeedsCompilation: | no |
Packaged: | 2025-06-14 03:20:58 UTC; r |
Author: | Hideo Aizaki [aut, cre] |
Maintainer: | Hideo Aizaki <azk-r@spa.nifty.com> |
Repository: | CRAN |
Date/Publication: | 2025-06-14 03:50:05 UTC |
R Commander Plug-in for Case 3 Best-Worst Scaling
Description
This package adds menu items for case 3 (multi-profile case) best–worst scaling (BWS3) to the R Commander. BWS3 is a question-based survey method that designs various combinations of attribute levels (profiles), asks respondents to select the best and worst profiles in each choice set, and then measurespreferences for the attribute levels by analyzing the responses. For details on BWS3, refer to Louviere et al. (2015).
Details
This package is an R Commander plug-in package for case 3 best–worst scaling (BWS3). It depends on support.BWS3 (Aizaki 2019), support.CEs (Aizaki 2012, 2023), survival (Therneau 2023; Therneau and Grambsch 2000), and Rcmdr (Fox 2005, 2017; Fox and Bouchet-Valat 2023). Refer to Aizaki (2019) and ‘Non-Market Valuation with R’ <https://nmvr.skr.jp/> for a brief introduction to BWS3 in R. A manual for this package is available at <https://sites.google.com/view/r4sp/rcmdrplugin>.
After successfully installing and loading RcmdrPlugin.BWS3,
the R Commander window will appear, and then you will find ‘BWS3
’
added to the top-level menus in the R Commander window.
Selecting ‘BWS3
’ displays menu items. When selecting a menu item,
the corresponding dialog box opens. The following dialog boxes are
provided by RcmdrPlugin.BWS3:
The dialog box for ‘
Design choice sets...
’ designs choice sets for BWS3 with the rotation design method or mix-and-match method using the functionrotation.design
in support.CEs.The dialog box for ‘
Display questions...
’ shows BWS3 questions that are converted from the choice sets designed in the first dialog box using the functionquestionnaire
in support.CEs.The dialog box for ‘
Collect responses...
’ shows three types of dialog boxes to collect user's responses to BWS3 questions according to choice sets designed in previous dialog box.The dialog box for ‘
Create data set for analysis...
’ creates a data set for BWS3 analysis from the choice sets designed in the first dialog box and a data set containing responses to BWS3 questions using the functionbws3.dataset
in support.BWS3. The current version assumes that a maximum difference model is used. The menu item ‘Create data set for analysis...
’ is activated if a data set is selected as the active data set.The dialog box for ‘
Create interactions...
’ creates interactions between attribute/level variables and covariates in the data set for BWS3 analysis. The menu item is activated if the data set for BWS3 analysis created in the previous daialog box is selected as the active data set.The dialog box for ‘
Fit model...
’ implements a conditional logit model analysis of the data set for analysis created in the previous dialog box using the functionsclogit
in survival andgofm
in support.CEs. The menu item ‘Fit model...
’ is activated if the data set for BWS3 analysis created in the previous dialog box is selected as the active data set.The dialog box for ‘
Calculate MWTP...
’ calculates marginal willingness to pays (MWTPs) of non-monetary variables from the model fitted in the previous dialog box using the functionmwtp
in support.CEs. The menu item ‘Calculate MWTP...
’ is activated if the fitted model is selected as the active model.The dialog box for ‘
Load saved objects...
’ loads an R Data (rda) file saved in the dialog box for ‘Design choice sets...
’ or ‘Create data set for analysis...
’ using the functionload
in base.
Acknowledgments
This work was supported by JSPS KAKENHI Grant Number JP20K06251.
Author(s)
Hideo Aizaki
References
Aizaki H (2012) Basic Functions for Supporting an Implementation of Choice Experiments in R. Journal of Statistical Software, 50(C2): 1–24. https://www.jstatsoft.org/article/view/v050c02.
Aizaki H (2019) support.BWS3: Tools for Case 3 Best-Worst Scaling. R package version 0.2-0. https://CRAN.R-project.org/package=support.BWS3.
Aizaki H (2023) support.CEs: Basic Functions for Supporting an Implementation of Choice Experiments. R package version 0.6-0. https://CRAN.R-project.org/package=support.CEs.
Fox J (2005) The R Commander: A Basic Statistics Graphical User Interface to R. Journal of Statistical Software, 14(9): 1–42. https://www.jstatsoft.org/article/view/v014i09.
Fox J (2017) Using the R Commander: A Point-and-Click Interface for R. Chapman and Hall/CRC.
Fox J, Bouchet-Valat M (2023) Rcmdr: R Commander. R package version 2.9-1. https://CRAN.R-project.org/package=Rcmdr.
Louviere JJ, Flynn TN, Marley AAJ (2015) Best–Worst Scaling: Theory, Methods and Applications. Cambridge University Press.
Therneau T (2023) survival: Survival Analysis. R package version 3.5-7. https://CRAN.R-project.org/package=survival.
Therneau TM, Grambsch PM (2000) Modeling Survival Data: Extending the Cox Model. Springer.
Examples
if(interactive()) {
library(RcmdrPlugin.BWS3)
}
Create Data Set for BWS3 Analysis
Description
Create a data set for BWS3 analysis from choice sets for BWS3 and data set containing responses to BWS3 questions.
Details
This dialog box creates a data set for BWS3 analysis from the choice sets
designed in the ‘Design Choice Sets for BWS3
’ dialog box and
a data set containing responses to BWS3 questions by using the function
bws3.dataset
in support.BWS3.
The current version assumes that a maximum difference model is used.
This dialog box is activated if the data set for BWS3 analysis is
selected as the active data set. For details on the results of this dialog box,
refer to help for function bws3.dataset
.
GUI elements of this dialog box are as follows.
-
Name for data set
: An R object name into which a data set generated using this dialog box is stored. The default name ‘BWS3data
’ can be changed following R's rules for naming objects. If changed, you should take note of the new object name, which will be used later. -
Save to file
: A check box for saving the resultant data set to an external file in RDA format (.rda
). If necessary, check this box. -
Design
: An R object name containing BWS3 choice sets generated in the ‘Design Choice Sets for BWS3
’ dialog box. The default name ‘BWS3design
’ is displayed automatically. The correct name should be entered if the name of BWS3 choice sets (BWS3design
) was changed in the dialog box for BWS3 design. -
ID variable
: A variable name identifying respondents. The default name ‘id
’ can be changed according to the corresponding variable name in the active data set. -
Number of BWS3 questions
: A number of BWS3 questions per respondent. According to the design parameters set in the first dialog box, this slider is set at the appropriate number. Depending on the value, the number of rows of the ‘Names of best- and worst-response variables
’ table varies. -
Letters of best- and worst-response variables
: A type of letters used for best- and worst-variable names shown in the ‘Names of best- and worst-variable names
’ table. Select one from three radio buttons corresponding to ‘Uppercase
’, ‘Lowercase
’, and ‘None
’. According to the selection, letters of best- and worst variable names in the table are changed. When selecting ‘None
’, no variable names appear in the table. Users must type appropriate names in each cell of the table. -
Opt-out option
: A check box for an opt-out option. If the opt-out option was used in the BWS3 questions, check this box. -
Names of best- and worst-response variables
: The names given for the best- and worst-response variables stored in the active data set. These names must follow R's rules for naming variables.
Please click the ‘Cancel
’ button and open this dialog box again
if it does not work as expected.
Design Choice Sets for BWS3
Description
Design choice sets for BWS3 with the rotation design method or mix-and-match method.
Details
This dialog box designs choice sets for BWS3 with the rotation design
method or mix-and-match method using the function
rotation.design
in support.CEs.
For details on the results of this dialog box, refer to help for function
rotation.design
.
GUI elements of this dialog box are as follows.
-
Name for design
: An R object name into which choice sets generated using this dialog box are stored. The default name ‘BWS3design
’ can be changed following R's rules for naming objects. If changed, you should take note of the new object name, which will be used later. -
Save to file
: A check box that is used to save the resultant design to an external file in RDA format (.rda
). If necessary, check this box. -
Design method
: A method used to generate BWS3 choice sets. Select one from two radio buttons corresponding to ‘Rotation
’ and ‘Mix-and-Match
’. For the details on these methods, see help for functionrotation.design
. -
Design parameters
: A specification of parameters for BWS3 choice sets. -
Number of alternatives per set (without opt-out)
: Number of alternatives per choice set (question), where an opt-out option is not counted as this number even if the opt-out option will be used in your survey. -
Number of blocks
: The number of blocks into which the resultant BWS3 choice sets are divided. -
Attributes and their levels
: A specification (table) of attributes and their levels used to generate BWS3 choice sets. -
Quantitative
: A check box showing that a quantitative attribute is set in the corresponding row. -
Attribute
: An attribute variable name following R's rules for naming variables. Type names without skipping from the first row. -
Level 1
toLevel 6
: Level variable names corresponding to the attribute entered in the first column. These variable names must also follow R's rules for naming variables. Type names without skipping from the ‘Level 1
’. -
Reproducibility
: A set for reproducibility of the resultant BWS3 choice sets. -
Seed for random number generator (optional)
: An integer value used as a seed for generating random numbers. If reproducibility is needed, type an arbitrary value into this box. -
Reproduce choice sets designed with R < 3.6.0
: A check box for reproducing BWS3 choice sets generated with R versions older than 3.6.0. If necessary, check this box.
Create Interactions between Attributes/Levels and Covariates
Description
Create interactions between attribute/level variables and covariates in the data set for BWS3 analysis.
Details
This dialog box creates interactions between attribute/level variables and
covariates in the data set for BWS3 analysis.
This dialog box is activated if the data set for BWS3 analysis created in
the ‘Create Data Set for BWS3 Analysis
’ dialog box is selected
as the active data set.
GUI elements of this dialog box are as follows.
-
Attribute/level variables
: Variables to be used as attribute and/or level variables in the model. Select one or more variables from this list box. -
Covariates
: Variables to be used as covariates in the model. Select one or more variables from this list box.
Fit Model to BWS3 Data
Description
Fit a model to BWS3 data.
Details
This dialog box fits the conditional logit model to the data set for BWS3
analysis using the functions clogit
in survival
and gofm
in support.CEs.
This dialog box is activated if the data set for BWS3 analysis created in
the ‘Create Data Set for BWS3 Analysis
’ dialog box is selected
as the active data set.
For details on the results of this dialog box, refer to helps for
clogit
and gofm
.
GUI elements of this dialog box are as follows.
-
Name for model
: An R object name into which the results of a fitted model obtained through this dialog box are stored. The default name ‘BWS3model.x
’, wherex
indicates the integer number assigned automatically from1
, can be changed following R's rules for naming objects. -
Response variable
: A variable containing responses to BWS3 questions in the active data set. This variable name is fixed as ‘RES
’, which cannot be changed by users (A fixed variable is colored in green). -
Independent variables
: Variables used as independent variables in the model. Select one or more variables from this list box. -
Stratification variable
: A variable for identifying each combination of respondents and BWS3 questions. This variable name is fixed as ‘STR
’. -
Subset expression
: A logical expression for specifying a subset of the observations in the active dataset to be used for the fitting.
Calculate Marginal Willingness to Pay
Description
Calculate marginal willingness to pay (MWTP) values of nonmonetary variables from the fitted model.
Details
This dialog box calculates MWTP values of nonmonetary variables from
the model fitted in the ‘Fit Model to BWS3 Data
’ dialog box
using the function mwtp
in support.CEs.
This dialog box is activated if the fitted model is selected as the active
model.
For details on the results of this dialog box, refer to help for function
mwtp
.
GUI elements of this dialog box are as follows.
-
Name for output
: An R object name into which the calculated results obtained through this dialog box are stored. The default name ‘MWTP
’ can be changed following R's rules for naming objects. -
Monetary variable
: A variable used as the monetary variable in the calculation of MWTPs. Select one from this drop-down list of variables. -
Nonmonetary variables
: Variables used as the nonmonetary variable(s) in the calculation of MWTP(s). Select one or more variables from this list box. -
Calculation method
: A method used to calculate confidence intervals for MWTPs. Select one from two radio buttons corresponding to ‘Krinsky and Robb
’ and ‘Delta
’. For the details on these methods, see help for functionsmwtp
. -
Confidence level
: A confidence level used for calculating the confidence intervals for MWTPs. The default is0.95
. -
Number of replications
: A total number of replications for the Krinsky and Robb method. -
Seed for random number generator (optional)
: An integer value used as a seed for generating random numbers. If reproducibility is needed, type an arbitrary value into this box.
Display BWS3 Questions
Description
Display a series of questions for BWS3.
Details
This dialog box shows a series of BWS3 questions that are converted from
the choice sets designed in the ‘Design Choice Sets for BWS3
’
dialog box using the function questionnaire
in
support.CEs.
For details on the results of this dialog box, refer to help for
questionnaire
.
GUI element of this dialog box is as follows.
-
Design
: An R object name containing BWS3 choice sets generated in the ‘Design Choice Sets for BWS3
’ dialog box. The default name ‘BWS3design
’ is displayed automatically. The correct name should be entered if the name of BWS3 choice sets (BWS3design
) was changed in the dialog box for BWS3 design.
Collect Responses to BWS3 Questions
Description
Collect user's responses to BWS3 questions.
Details
Three types of dialog boxes are provided to collect user's responses to
BWS3 questions that are converted from the choice sets designed in
the ‘Design Choice Sets for BWS3
’ dialog box.
The first dialog box (‘Set Options for Response Collection
’)
sets four options for response collections:
-
Design
: An R object name containing BWS3 choice sets generated in the ‘Design Choice Sets for BWS3
’ dialog box. The default name ‘BWS3design
’ is displayed automatically. The correct name should be entered if the name of BWS3 choice sets (BWS3design
) was changed in the dialog box for BWS3 design. -
Opt-out option
: When the opt-out option will be used in the BWS3 questions, check this box. -
Save to file
: When the user's responses should be saved to an external file in CSV format (.csv
), check this box. -
Block number
: When the BWS3 choice sets are divided into two or more blocks, set the block number to which the user will be assigned.
After confirming all the settings on the first dialog box, press
the ‘OK
’ button to continue.
A series of dialog boxes (‘Collect Responses to BWS3 Questions
’)
sequentially opens to collect the user's responses to BWS3 questions.
In each dialog box,
alternatives designed in the ‘Design Choice Sets for BWS3
’
dialog box are presented. The user is asked to select their best and worst
alternatives from the drop-down list boxes. After making the selection,
the user clicks the ‘OK
’ button to open a new dialog box
corresponding to the next BWS3 question.
When all user responses to BWS3 questions have been collected, a dialog
box (‘Save As
’) opens if the ‘Save to file
’
option was selected in the first dialog box. This saves the user's
responses to an external file in CSV format.