| getModelResults | R Documentation |
Returns a data frame of the estimated coefficients and standard errors for each parameter in each model in a data frame of estimated models.
getModelResults(models)
models |
A data frame containing estimated models for a series of
different sample sizes, obtained using the |
A data frame of the estimated coefficients and standard errors for each parameter in each model.
library(conjointTools)
# Define the attributes and levels
levels <- list(
price = seq(1, 4, 0.5), # $ per pound
type = c('Fuji', 'Gala', 'Honeycrisp', 'Pink Lady', 'Red Delicious'),
freshness = c('Excellent', 'Average', 'Poor')
)
# Make a full-factorial design of experiment and recode the levels
doe <- makeDoe(levels)
doe <- recodeDoe(doe, levels)
# Make the survey
survey <- makeSurvey(
doe = doe, # Design of experiment
nResp = 2000, # Total number of respondents (upper bound)
nAltsPerQ = 3, # Number of alternatives per question
nQPerResp = 6 # Number of questions per respondent
)
# Simulate random choices for the survey
data <- simulateChoices(
survey = survey,
obsID = "obsID"
)
# Estimate models with different sample sizes
models <- estimateModels(
nbreaks = 10,
data = data,
pars = c("price", "type", "freshness"),
outcome = "choice",
obsID = "obsID"
)
# Extract coefficients and standard errors from models
results <- getModelResults(models)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.