Marketing - MaxDiff - Ensemble of Models
Create an ensemble of MaxDiff models by averaging the respondent parameters. The output may either be a table comparing the underlying models and the ensemble, or histograms of respondent parameters of the ensemble. In either case, MaxDiff functions to save variables (e.g. Individual-level Coefficients) may be applied to the ensemble.
Example
To run the ensemble in Displayr, use the Compare Models function by selecting Insert > More > MaxDiff > Compare Models and select the Ensemble option.
To run the ensemble in Q, select Create > Marketing > MaxDiff > Compare Models and select the Ensemble option.
Options
MaxDiff models created in Displayr and Q are used as the inputs to the ensemble. The inputs are shown in the image below.
Options
Input models At least 2 MaxDiff models.
Ensemble Whether to create an ensemble by taking the average of the respondent parameters across the models.
Output
- Comparison A table comparing metrics from models (and the ensemble, if selected).
- Ensemble Histograms of respondent parameters, as per the underlying MaxDiff outputs.
Histograms of ensemble parameters
More information
See Comparing MaxDiff Models and Creating Ensembles blog post for an example of comparing models.
Code
var __webpack_modules__ = ({});
// The module cache
var __webpack_module_cache__ = {};
// The require function
function __webpack_require__(moduleId) {
// Check if module is in cache
var cachedModule = __webpack_module_cache__[moduleId];
if (cachedModule !== undefined) {
return cachedModule.exports;
}
// Create a new module (and put it into the cache)
var module = (__webpack_module_cache__[moduleId] = {
exports: {}
});
// Execute the module function
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
// Return the exports of the module
return module.exports;
}
// webpack/runtime/rspack_version
(() => {
__webpack_require__.rv = () => ("1.7.2")
})();
// webpack/runtime/rspack_unique_id
(() => {
__webpack_require__.ruid = "bundler=rspack@1.7.2";
})();
var controls = [];
var modelsInput = form.dropBox({ label: "Input models", types: ["RItem:FitMaxDiff"], name: "formModels",
multi: true, required: true, min_inputs: 2,
prompt: "Select at least 2 MaxDiff models." });
controls.push(modelsInput);
var ensemble = form.checkBox({ label: "Ensemble", name: "formEnsemble", default_value: true,
prompt: "Whether to create an ensemble of the models." });
controls.push(ensemble);
if (ensemble.getValue()) {
var output = form.comboBox({ label: "Output",
alternatives: ["Comparison", "Ensemble"], name: "formOutput", default_value: "Comparison",
prompt: "A table comparing the models, or histograms of ensemble respondent coefficients." });
controls.push(output);
}
form.setInputControls(controls);
var heading_text = 'Compare MaxDiff Models';
var plural_text = 'Comparisons of MaxDiff Models';
if (ensemble.getValue()) {
heading_text = 'Ensemble of MaxDiff Models';
plural_text = 'Ensembles of MaxDiff Models';
}
if (!!form.setObjectInspectorTitle)
form.setObjectInspectorTitle(heading_text, plural_text);
else
form.setHeading(heading_text);
library(flipMaxDiff)
ensemble <- MaxDiffEnsemble(formModels,
!formEnsemble,
get0("formOutput", ifnotfound = "Comparison"))
Further reading: MaxDiff software