Skip to content
Snippets Groups Projects
Commit caa26fcc authored by dj44vuri's avatar dj44vuri
Browse files

added a second way to transform utility beta coefficients

parent f9fb29d4
No related branches found
No related tags found
No related merge requests found
......@@ -14,7 +14,7 @@
#' @examples \dontrun{ simchoice(designfile="somefile", no_sim=10, respondents=330,
#' mnl_U,ut=u[[1]] ,destype="ngene")}
#'
sim_choice <- function(designfile, no_sim=10, respondents=330,ut ,destype=destype, bcoefficients, decisiongroups=c(0,1), manipulations = list() , estimate, chunks=1) {
sim_choice <- function(designfile, no_sim=10, respondents=330,ut ,destype=destype, bcoefficients, decisiongroups=c(0,1), manipulations = list() , estimate, chunks=1, utility_transform_type = "simple") {
......@@ -29,7 +29,8 @@ sim_choice <- function(designfile, no_sim=10, respondents=330,ut ,destype=destyp
transform_util2 <- function() {
mnl_U <-paste(purrr::map_chr(ut[[1]],as.character,keep.source.attr = TRUE),collapse = "",";") %>%
stringr::str_replace_all( c( "priors\\[\"" = "" , "\"\\]" = "" , "~" = "=", "\\." = "_" , "V_"="U_"))
stringr::str_replace_all( c( "priors\\[\"" = "" , "\"\\]" = "" , "~" = "=", "\\." = "_" , "V_"="U_")) %>%
stringr::str_replace_all(setNames(paste0("@", names(bcoefficients)), names(bcoefficients)))
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment