Title: | DCE Data Reshaping and Processing |
---|---|
Description: | Prepare the results of a DCE to be analysed through choice models.'DCEmgmt' reshapes DCE data from wide to long format considering the special characteristics of a DCE. 'DCEmgmt' includes the function 'DCEestm' which estimates choice models once the database has been reshaped with 'DCEmgmt'. |
Authors: | Daniel Perez-Troncoso [aut, cre] |
Maintainer: | Daniel Perez-Troncoso <[email protected]> |
License: | GPL-3 |
Version: | 0.0.1 |
Built: | 2024-11-07 06:34:44 UTC |
Source: | CRAN |
Survey data from the DCE in Consumers' preferences and WTP for personalised nutrition (https://doi.org/10.1007/s40258-021-00647-3)
data(survey)
data(survey)
An object of class tbl_df
(inherits from tbl
, data.frame
) with 242 rows and 21 columns.
doi:10.1007/s40258-021-00647-3DOI
P?rez-Troncoso et al. (2021) Applied Health Economics and Health Policy 19, 757-767 (PubMed)
data <- data(survey)
data <- data(survey)
Coded dataset
data(data.c)
data(data.c)
An object of class data.frame
with 3744 rows and 20 columns.
doi:10.1007/s40258-021-00647-3
Perez-Troncoso et al. (2021) Applied Health Economics and Health Policy 19, 757-767 (PubMed)
data. <- data(data.c)
data. <- data(data.c)
Prepare the results of a DCE to be analysed through choice models.
DCEmgmt(data, droprow, keepvar, create.id, blocks, sets, alts, options, design)
DCEmgmt(data, droprow, keepvar, create.id, blocks, sets, alts, options, design)
data |
Data.frame with the survey data in wide data format. See 'data(survey)' |
droprow |
Rows to be deleted. Specify a single row (droprow = x) or more than one (dropdown = x:y). |
keepvar |
Select the case-specific variables to be kept. For example: keepvar = c("x", "y"). |
create.id |
Create a variable called "id" with a unique identificator per respondent. create.id = TRUE |
blocks |
Specifies the variables designating each choice set block. Each choice set variable must be named as a letter (for instance Q) followed by a number (starting by 1). Thus, the first block of choice sets can be named Q1, Q2, Q3, Q4 whereas the second can be called F5, F6, F7, F8. In this case, block = c("Q", "F"). If there is only one block, block = c("Q"). |
sets |
Specify the number of choice sets per block. If there is only one block, specify the total number of choice sets. For instance, sets = 8. |
alts |
Specify the number of alternatives per choice set. For example, alts = 3. |
options |
Vector indicating the string used to designate the choice. For example, option = c("Option A", "Option B", "Option C"). See examples. |
design |
Data frame with the design matrix in dummy or effects coding. PONER EJEMPLO |
data(survey) data(design) data.c<-DCEmgmt(data = data, droprow = 1:5, keepvar = c("age", "height"), create.id = TRUE, blocks = c("B1_", "B2_"), sets = 8, alts = 2, options = c("Prefiero el servicio A", "Prefiero el servicio B"), design = design) #The data frame data.c contains the coded DCE data
data(survey) data(design) data.c<-DCEmgmt(data = data, droprow = 1:5, keepvar = c("age", "height"), create.id = TRUE, blocks = c("B1_", "B2_"), sets = 8, alts = 2, options = c("Prefiero el servicio A", "Prefiero el servicio B"), design = design) #The data frame data.c contains the coded DCE data
Design matrix from the DCE in Consumers' preferences and WTP for personalised nutrition (https://doi.org/10.1007/s40258-021-00647-3)
data(design)
data(design)
An object of class tbl_df
(inherits from tbl
, data.frame
) with 32 rows and 14 columns.
doi:10.1007/s40258-021-00647-3
P?rez-Troncoso et al. (2021) Applied Health Economics and Health Policy 19, 757-767 (PubMed)
design <- data(design)
design <- data(design)