dimRandoTest | R Documentation |
dimRandoTest
checks data from conjoint experiments for randomization
problems by checking for associations between vignette attributes and
respondent-level variables.
dimRandoTest(data, attributes, resvar, vartype)
data |
A data.frame (in long format). |
attributes |
A character vector of vignette attributes' names in the dataset. |
resvar |
A respondent-level variable. |
vartype |
The type (measurement level) of the respondent variable. ("metric" or "categorical"). If vartype is "categorical", the variable needs to be stored as a factor in the dataset. |
If the respondent-level variable is categorical (e.g., gender), the function cross-tabulates each vignette attribute with the respondent-level variable, computes a chi-squared test, and compiles the results.
If the respondent-level variable is metric (e.g., income), the function runs a one-way ANOVA with the respondent-level variable as the dependent and each vignette attribute as the independent variable and compiles the results.
Users need to specify whether their respondent-level variable is metric or categorical.
Important: If the experiment involved multiple rating or choice rounds per respondent, then the tests should be run separately for each round.
In both cases, a rejected null (small p-value) indicates that there is some statistically significant association between a given profile attribute and the respondent variable, which in turn signals that there might have been issues with the random assignment of vignettes to respondents.
The result can be plotted (using plot()) or exported as a tidy data.frame (using as.data.frame()).
A list of class 'dimRandoTest'. Can be converted to a tidy data.frame with as.data.frame().
## Not run: dimRandoTest(data=experimentdata[which(experimentdata$round==1),], attributes=c("age","nationality","gender"), resvar = "respondent_gender", vartype = "categorical") dimRandoTest(data=experimentdata[which(experimentdata$round==1),], attributes=c("age","nationality","gender"), resvar = "respondent_income", vartype = "metric") ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.