Choice Modeling - Diagnostic - Experimental Design - Numeric Design
Jump to navigation
Jump to search
Displayr - Anything Menu
Q Technical Reference
Q Technical Reference
Q Technical Reference > Setting Up Data > Creating New Variables
Q Technical Reference > Updating and Automation > Automation Online Library
Q Technical Reference > Updating and Automation > JavaScript > QScript > QScript Examples Library > QScript Online Library
R Online Library
Create an output containing a numeric version of the design
Outputs a numeric version of a Choice Modeling - Experimental Design output, with the labels of attributes replaced by integers.
Example
The table below shows the numeric version of a design with 2 attributes, Color and Speed, each of which has 3 levels.
References
See Choice Modeling - Experimental Design
Code
includeWeb("QScript R Output Functions");
main();
function main() {
// The following 2 variables contain information specific to this diagnostic.
var required_class = "ChoiceModelDesign";
var output_name_suffix = "numeric.design";
var item = checkSelectedItemClass(required_class);
if (item == null)
return false;
var r_name = stringToRName(item.referenceName);
// The following lines contain the R code to run
var expression = "sapply(" + r_name + "$labeled.design, as.numeric)";
return createROutput(item, expression, output_name_suffix);
}
Displayr - Anything Menu
Q Technical Reference
Q Technical Reference
Q Technical Reference > Setting Up Data > Creating New Variables
Q Technical Reference > Updating and Automation > Automation Online Library
Q Technical Reference > Updating and Automation > JavaScript > QScript > QScript Examples Library > QScript Online Library
R Online Library