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.
ID
Identification number of respondents.
BLOCK
Serial number of blocks to which each respondent had been assigned.
q1
Response to choice experiment question 1.
q2
Response to choice experiment question 2.
q3
Response to choice experiment question 3.
q4
Response to choice experiment question 4.
q5
Response to choice experiment question 5.
q6
Response to choice experiment question 6.
q7
Response to choice experiment question 7.
q8
Response to choice experiment question 8.
q9
Response to choice experiment question 9.
F
Female 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.