# NOT RUN {
# Example without continuous attributes.
design <- example_design
coded <- c("D", "D", "D") # Coding.
# Levels as they should appear in survey.
al <- list(
c("$50", "$75", "$100"), # Levels attribute 1.
c("2 min", "15 min", "30 min"), # Levels attribute 2.
c("bad", "moderate", "good") # Levels attribute 3.
)
# Decode
Decode(des = design, n.alts = 2, lvl.names = al, coding = coded)
# Example with alternative specific constants
design <- example_design2
coded <- c("D", "D", "D") # Coding.
# Levels as they should appear in survey.
al <- list(
c("$50", "$75", "$100"), # Levels attribute 1.
c("2 min", "15 min", "30 min"), # Levels attribute 2.
c("bad", "moderate", "good") # Levels attribute 3.
)
# Decode
Decode(des = design, n.alts = 3, lvl.names = al, coding = coded, alt.cte = c(1, 1, 0))
# }
Run the code above in your browser using DataLab