Skip to content

Commit

Permalink
fix typo issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jhelvy committed Feb 23, 2023
1 parent 745a1f5 commit 91ea935
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Authors@R: c(
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: 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>.
License: MIT + file LICENSE
Encoding: UTF-8
LazyData: true
Expand Down
8 changes: 4 additions & 4 deletions R/design.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#' This function creates a data frame containing a choice-based conjoint survey
#' design where each row is an alternative. Designs can be either a
#' randomized or Bayesian D-efficient, in which case an implementation of the
#' CEA or Modfed Federov algorithm is used via the `idefix` package
#' CEA or Modfed Federov algorithm is used via the {idefix} package
#'
#' @keywords logitr mnl mxl mixed logit design
#' @param profiles A data frame in which each row is a possible profile.
Expand Down Expand Up @@ -140,9 +140,9 @@ cbc_design <- function(
if (is.null(priors)) {
design <- make_design_rand(profiles, n_resp, n_alts, n_q, no_choice, label)
} else if (!is.null(label)) {
message(
warning(
"The use of the 'label' argument is currently only compatible with ",
"randomized designs, so the provided priors are being ignored.\n"
"randomized designs, so the provided 'priors' are being ignored.\n"
)
design <- make_design_rand(profiles, n_resp, n_alts, n_q, no_choice, label)
} else {
Expand Down Expand Up @@ -179,7 +179,7 @@ get_design_rand <- function(profiles, n_resp, n_alts, n_q) {
get_design_rand_label <- function(profiles, n_resp, n_alts, n_q, label) {
n_levels <- length(unique(profiles[, label]))
if (n_levels != n_alts) {
message(
warning(
"The supplied 'n_alts' argument is being ignored and set to ", n_levels,
" to match the number of unique levels in the ", label,
" variable.\n"
Expand Down
2 changes: 1 addition & 1 deletion R/input_checks.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ check_inputs_design <- function(
if (no_choice) {
if (!is.null(priors) & is.null(prior_no_choice)) {
stop(
'If no_choice = TRUE, you must specify the prior utility ',
"If 'no_choice = TRUE', you must specify the prior utility ",
'value for the "no choice" option using prior_no_choice'
)

Expand Down
5 changes: 3 additions & 2 deletions R/power.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#' cores is set to `parallel::detectCores() - 1`. Max cores allowed is capped
#' at `parallel::detectCores()`.
#' @param ... Other arguments that are passed to `logitr::logitr()` for model
#' estimation. See the `logitr` documentation for details about other
#' estimation. See the {logitr} documentation for details about other
#' available arguments.
#' @return Returns a data frame of estimated model coefficients and standard
#' errors for the same model estimated on subsets of the `data` with increasing
Expand Down Expand Up @@ -81,7 +81,8 @@
#' outcome = "choice",
#' obsID = "obsID",
#' nbreaks = 10,
#' n_q = 6
#' n_q = 6,
#' n_cores = 2
#' )
cbc_power <- function(
data,
Expand Down

0 comments on commit 91ea935

Please sign in to comment.