| rice | R Documentation |
Data set artificially created for an example based on an unlabeled DCE design. This example illustrates consumers' valuation of rice.
data(rice)
Data frames with 100 respondents on the following 12 variables.
IDIdentification number of respondents.
BLOCKSerial number of blocks to which each respondent had been assigned.
q1Response to choice experiment question 1.
q2Response to choice experiment question 2.
q3Response to choice experiment question 3.
q4Response to choice experiment question 4.
q5Response to choice experiment question 5.
q6Response to choice experiment question 6.
q7Response to choice experiment question 7.
q8Response to choice experiment question 8.
q9Response to choice experiment question 9.
FFemale dummy variable (1 = Female, otherwise 0).
Hideo Aizaki
make.dataset, make.design.matrix, rotation.design, clogit
library(survival)
if(getRversion() >= "3.6.0") RNGkind(sample.kind = "Rounding")
d.rice <- rotation.design(
attribute.names = list(
Region = c("RegA", "RegB", "RegC"),
Cultivation = c("Conv", "NoChem", "Organic"),
Price = c("1700", "2000", "2300")),
nalternatives = 2,
nblocks = 1,
row.renames = FALSE,
randomize = TRUE,
seed = 987)
data(rice)
dm.rice <- make.design.matrix(
choice.experiment.design = d.rice,
optout = TRUE,
categorical.attributes = c("Region", "Cultivation"),
continuous.attributes = c("Price"),
unlabeled = TRUE)
ds.rice <- make.dataset(
respondent.dataset = rice,
choice.indicators =
c("q1", "q2", "q3", "q4", "q5",
"q6", "q7", "q8", "q9"),
design.matrix = dm.rice)
fm.rice <- RES ~ ASC + RegB + RegC + NoChem + Organic +
NoChem:F + Organic:F + Price + strata(STR)
out.rice <- clogit(fm.rice, data = ds.rice)
out.rice
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.