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

minor changes

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