diff --git a/Projects/feedadditives/parameters_feedadd.R b/Projects/feedadditives/parameters_feedadd.R index 33b0ae5e4f29d440ebb4e87a0de5078818811276..bb961434e1227fa53bd57e64973f586b7410a7ad 100644 --- a/Projects/feedadditives/parameters_feedadd.R +++ b/Projects/feedadditives/parameters_feedadd.R @@ -2,8 +2,11 @@ designpath<- "Projects/feedadditives/Designs/" -resps =360 # number of respondents -nosim=500 # number of simulations to run (about 500 is minimum) +notes <- "This design consists of different heuristics. One group did not attend the methan attribute, another group only decided based on the payment" + + +resps =3600 # number of respondents +nosim=2 # number of simulations to run (about 500 is minimum) #betacoefficients should not include "-" basc = 0.2 @@ -13,13 +16,21 @@ bvet = 0.3 bfar = 0.3 bmet = 0.3 bbon = 0.3 +bbon2 = 1.9 - +decisiongroups=c(0,0.6,0.8,1) #place your utility functions here -u<- list(u1= - list( +u<- list(u1= list( v1 =V.1 ~ bcow*alt1.cow + badv * alt1.adv + bvet * alt1.vet + bfar * alt1.far + bmet*alt1.met + bbon * alt1.bon, v2 =V.2 ~ bcow*alt2.cow + badv * alt2.adv + bvet * alt2.vet + bfar * alt2.far + bmet*alt2.met + bbon * alt2.bon, - v3 =V.3 ~ basc) + v3 =V.3 ~ basc) , + u2 = list( + v1 =V.1 ~ bcow*alt1.cow + badv * alt1.adv + bvet * alt1.vet + bfar * alt1.far + bbon * alt1.bon, + v2 =V.2 ~ bcow*alt2.cow + badv * alt2.adv + bvet * alt2.vet + bfar * alt2.far + bbon * alt2.bon, + v3 =V.3 ~ basc), + u3 = list( + v1 =V.1 ~ bbon2 * alt1.bon, + v2 =V.2 ~ bbon2 * alt2.bon, + v3 =V.3 ~ basc) ) diff --git a/functions.R b/functions.R index 0f2ce8cd562812264e9137ebea29b2686abbc056..3ed3146813d03f3db46a903e487638ebf73784c2 100644 --- a/functions.R +++ b/functions.R @@ -126,7 +126,7 @@ print(head(data)) return(model) } - + designs_all <- list() design <- read_delim(designfile,delim = "\t", diff --git a/generatemd.R b/generatemd.R index a03acb82feb97b3e762ebe66f65540cc39eac4ea..32ab29f402e9e764bd0ebc6952c63a29bbbed554 100644 --- a/generatemd.R +++ b/generatemd.R @@ -8,7 +8,7 @@ rm(list=ls()) rmarkdown::render("simulation_output.rmd", output_file = paste0( stringr::str_remove_all( - file,"parameters_|.R$"),"_noheur.html"), + file,"parameters_|.R$"),"_twoheur_n3600.html"), params = list(file=file) ) diff --git a/project.Rproj b/project.Rproj deleted file mode 100644 index 8e3c2ebc99e2e337f7d69948b93529a437590b27..0000000000000000000000000000000000000000 --- a/project.Rproj +++ /dev/null @@ -1,13 +0,0 @@ -Version: 1.0 - -RestoreWorkspace: Default -SaveWorkspace: Default -AlwaysSaveHistory: Default - -EnableCodeIndexing: Yes -UseSpacesForTab: Yes -NumSpacesForTab: 2 -Encoding: UTF-8 - -RnwWeave: Sweave -LaTeX: pdfLaTeX diff --git a/simulation_output.rmd b/simulation_output.rmd index f6e9be268225e4c415589315fae117f37cf6778a..301b9a5de0ed2bdb449c8325768b13b84feb2350 100644 --- a/simulation_output.rmd +++ b/simulation_output.rmd @@ -1,7 +1,7 @@ --- title: "Simulation experimental design" author: "" -date: "2023-01-05" +date: "`r format(Sys.time(), '%Y-%m-%d %H:%M:%S')`" params: file: "Projects/SE_DRIVE/parameters_SE_DRIVE.R" format: @@ -17,7 +17,7 @@ knitr::opts_chunk$set(echo = TRUE) ```{r run_code, message=FALSE, warning=FALSE, include=FALSE, paged.print=FALSE} -source("simulationcore_purrr.R" ,echo = TRUE) +source("simulationcore_purrr.R" ,echo = TRUE, local = knitr::knit_global() ) # retrieve the values of the objects starting with "b" using mget() # b_values <- mget(ls(pattern = "^b")) @@ -65,6 +65,12 @@ designs_all <- readRDS("output/330_5000runs_4designs_mixl.RDS") # Statistics and power + +```{r} +cat(notes) +``` + + Here you see the statistics of your parameters for the `r nosim` runs. ```{r}