miscmethods.cbc_errors {cbcTools} | R Documentation |
Methods for cbc_errors objects
Description
Miscellaneous methods for cbc_errors
class objects.
Usage
## S3 method for class 'cbc_errors'
plot(x, ...)
Arguments
x |
is an object of class |
... |
further arguments. |
Value
Returns a ggplot2 object plotting standard errors versus sample size.
Examples
library(cbcTools)
# A simple conjoint experiment about apples
# Generate all possible profiles
profiles <- cbc_profiles(
price = c(1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5),
type = c("Fuji", "Gala", "Honeycrisp"),
freshness = c('Poor', 'Average', 'Excellent')
)
# Make a survey design from all possible profiles
# (This is the default setting where method = 'full' for "full factorial")
design <- cbc_design(
profiles = profiles,
n_resp = 300, # Number of respondents
n_alts = 3, # Number of alternatives per question
n_q = 6 # Number of questions per respondent
)
# Simulate random choices
data <- cbc_choices(
design = design,
obsID = "obsID"
)
# Conduct a power analysis
power <- cbc_power(
data = data,
pars = c("price", "type", "freshness"),
outcome = "choice",
obsID = "obsID",
nbreaks = 10,
n_q = 6
)
# Visualize the results
plot(power)
[Package cbcTools version 0.5.0 Index]