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

minor changes

parent 2c7c23b9
Branches
No related tags found
No related merge requests found
......@@ -111,7 +111,7 @@ sim_all <- function(nosim=2, resps, destype=NULL, designpath, u, bcoeff, decisio
tictoc::tic()
all_designs<- purrr::map(designfile, sim_choice,
no_sim= nosim,respondents = resps, destype=destype, ut=u, bcoefficients = bcoeff, decisiongroups = decisiongroups, manipulations = manipulations) %>% ## iterate simulation over all designs
no_sim= nosim,respondents = resps, destype=destype, ut=u, bcoefficients = bcoeff, decisiongroups = decisiongroups, manipulations = manipulations, estimate = estimate) %>% ## iterate simulation over all designs
stats::setNames(designname)
......@@ -119,6 +119,8 @@ sim_all <- function(nosim=2, resps, destype=NULL, designpath, u, bcoeff, decisio
print(time)
if (estimate==TRUE) {
powa <- purrr::map(all_designs, ~ .x$power)
......@@ -155,6 +157,8 @@ sim_all <- function(nosim=2, resps, destype=NULL, designpath, u, bcoeff, decisio
all_designs[["summaryall"]] = summaryall
all_designs[["graphs"]]=p
all_designs[["powa"]]=powa
}
all_designs[["time"]]=time
all_designs[["arguements"]] = list( "Beta values" = bcoeff, "Utility functions" = u , "Decision groups" =decisiongroups , "Manipulation of vars" = manipulations,
"Number Simulations" = nosim, "Respondents" = resps, "Designpath" = designpath)
......
......@@ -13,7 +13,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 = TRUE) {
sim_choice <- function(designfile, no_sim=10, respondents=330,ut ,destype=destype, bcoefficients, decisiongroups=c(0,1), manipulations = list() , estimate) {
......@@ -95,7 +95,7 @@ designs_all <- list()
### start estimation
if (estimate==TRUE) {
if(estimate==TRUE) {
......
......@@ -11,7 +11,7 @@
#' @export
#'
#' @examples \dontrun{simulate_choices(datadet, ut,setspp)}
simulate_choices <- function(data, utility, setspp, destype, bcoefficients, decisiongroups = c(0,1), manipulations = list()) { #the part in dataset that needs to be repeated in each run
simulate_choices <- function(data, utility, setspp, destype, bcoefficients, decisiongroups = c(0,1), manipulations = list(), estimate) { #the part in dataset that needs to be repeated in each run
......
......@@ -13,7 +13,7 @@ sim_choice(
bcoefficients,
decisiongroups = c(0, 1),
manipulations = list(),
estimate = TRUE
estimate
)
}
\arguments{
......
......@@ -11,7 +11,8 @@ simulate_choices(
destype,
bcoefficients,
decisiongroups = c(0, 1),
manipulations = list()
manipulations = list(),
estimate
)
}
\arguments{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment