Skip to content

Commit

Permalink
Merge pull request #19 from jhelvy/orthogonal
Browse files Browse the repository at this point in the history
Orthogonal
  • Loading branch information
jhelvy authored Jun 30, 2023
2 parents d6b63e5 + 6049d31 commit b7ffda4
Show file tree
Hide file tree
Showing 20 changed files with 792 additions and 247 deletions.
7 changes: 3 additions & 4 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
Version: 0.3.4
Date: 2023-06-13 18:09:36 UTC
SHA:
dcb6aa72d97c124bb6194b5a5334c698d7062eb3
Version: 0.4.0
Date: 2023-06-30 18:30:53 UTC
SHA: 2daf0161a16357e90aea1fa42e0c452226a4f3fc
8 changes: 4 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Package: cbcTools
Title: Design and Evaluate Choice-Based Conjoint Survey Experiments
Version: 0.3.4
Title: A Simulation-Based Workflow to Design and Evaluate Choice-Based Conjoint Survey Experiments
Version: 0.4.0
Maintainer: John Helveston <[email protected]>
Authors@R: c(
person(given = "John",
family = "Helveston",
role = c("cre", "aut", "cph"),
email = "[email protected]",
comment = c(ORCID = "0000-0002-2657-9191")))
Description: Design and evaluate choice-based conjoint survey experiments in R. Generate survey designs, including randomized designs and Bayesian D-efficient designs as well as designs with "no choice" options and labeled designs. Conveniently inspect the design balance and overlap, and simulate choice data for a survey design either randomly or according to a multinomial or mixed logit utility model defined by user-provided prior parameters. Conduct power analyses on a survey design by estimating the same model multiple times using different subsets of the data to simulate different sample sizes. Choice simulation and model estimation are handled using the 'logitr' package, and Bayesian D-efficient designs are obtained using the 'idefix' package. For more details see Helveston (2023) <doi:10.18637/jss.v105.i10> and Traets et al (2020) <doi:10.18637/jss.v096.i03>.
Description: A simulation-based workflow to design and evaluate choice-based conjoint survey experiments. Generate a variety of survey designs, including full factorial designs, orthogonal designs, and Bayesian D-efficient designs as well as designs with "no choice" options and "labeled" (also known as "alternative specific") designs. Full factorial and orthogonal designs are obtained using the 'DoE.base' package (Grömping, 2018) <doi:10.18637/jss.v085.i05>. Bayesian D-efficient designs are obtained using the 'idefix' package (Traets et al, 2020) <doi:10.18637/jss.v096.i03>. Conveniently inspect the design balance and overlap, and simulate choice data for a survey design either randomly or according to a multinomial or mixed logit utility model defined by user-provided prior parameters. Conduct a power analysis for a given survey design by estimating the same model on different subsets of the data to simulate different sample sizes. Choice simulation and model estimation in power analyses are handled using the 'logitr' package (Helveston, 2023) <doi:10.18637/jss.v105.i10>.
License: MIT + file LICENSE
Encoding: UTF-8
LazyData: true
Expand All @@ -20,7 +20,7 @@ Suggests:
testthat,
tibble
Imports:
dplyr,
DoE.base,
fastDummies,
ggplot2,
idefix,
Expand Down
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ export(cbc_overlap)
export(cbc_power)
export(cbc_profiles)
export(cbc_restrict)
export(plot_compare_power)
export(randLN)
export(randN)
importFrom(ggplot2,aes)
importFrom(ggplot2,element_blank)
importFrom(ggplot2,expand_limits)
importFrom(ggplot2,facet_wrap)
importFrom(ggplot2,geom_hline)
importFrom(ggplot2,geom_point)
importFrom(ggplot2,ggplot)
Expand Down
14 changes: 10 additions & 4 deletions R/choices.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#' Simulate choices for a survey design
#'
#' Simulate choices for a survey design, either randomly or according to a
#' utility model defined by user-provided prior parameters.
#' utility model defined by user-provided prior parameters. All choices are
#' simulated using the 'logitr' package. For more details see the JSS article
#' on the 'logitr' package (Helveston, 2023).
#' @keywords logitr mnl mxl mixed logit simulation
#'
#' @param design A data frame of a survey design.
Expand All @@ -12,6 +14,9 @@
#' If `NULL` (the default), choices will be randomly assigned.
#' @param n_draws The number of Halton draws to use for simulated choices
#' for mixed logit models. Defaults to `100`.
#' @references
#' Helveston, J. P. (2023). logitr: Fast Estimation of Multinomial and Mixed Logit Models with Preference Space and Willingness-to-Pay Space Utility Parameterizations. Journal of Statistical Software, 105(10), 1–37,
#' \doi{10.18637/jss.v105.i10}
#' @return Returns the `design` data frame with an additional `choice` column
#' identifying the simulated choices.
#' @export
Expand All @@ -27,12 +32,13 @@
#' freshness = c('Poor', 'Average', 'Excellent')
#' )
#'
#' # Make a randomized survey design
#' # 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
#' n_alts = 3, # Number of alternatives per question
#' n_q = 6 # Number of questions per respondent
#' )
#'
#' # Simulate random choices
Expand Down
Loading

0 comments on commit b7ffda4

Please sign in to comment.