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

small modifications on feed additives

parent 27a8d1c8
Branches
Tags
No related merge requests found
...@@ -2,8 +2,11 @@ ...@@ -2,8 +2,11 @@
designpath<- "Projects/feedadditives/Designs/" designpath<- "Projects/feedadditives/Designs/"
resps =360 # number of respondents notes <- "This design consists of different heuristics. One group did not attend the methan attribute, another group only decided based on the payment"
nosim=500 # number of simulations to run (about 500 is minimum)
resps =3600 # number of respondents
nosim=2 # number of simulations to run (about 500 is minimum)
#betacoefficients should not include "-" #betacoefficients should not include "-"
basc = 0.2 basc = 0.2
...@@ -13,13 +16,21 @@ bvet = 0.3 ...@@ -13,13 +16,21 @@ bvet = 0.3
bfar = 0.3 bfar = 0.3
bmet = 0.3 bmet = 0.3
bbon = 0.3 bbon = 0.3
bbon2 = 1.9
decisiongroups=c(0,0.6,0.8,1)
#place your utility functions here #place your utility functions here
u<- list(u1= u<- list(u1= list(
list(
v1 =V.1 ~ bcow*alt1.cow + badv * alt1.adv + bvet * alt1.vet + bfar * alt1.far + bmet*alt1.met + bbon * alt1.bon, 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, 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)
) )
...@@ -126,7 +126,7 @@ print(head(data)) ...@@ -126,7 +126,7 @@ print(head(data))
return(model) return(model)
} }
designs_all <- list() designs_all <- list()
design <- read_delim(designfile,delim = "\t", design <- read_delim(designfile,delim = "\t",
......
...@@ -8,7 +8,7 @@ rm(list=ls()) ...@@ -8,7 +8,7 @@ rm(list=ls())
rmarkdown::render("simulation_output.rmd", rmarkdown::render("simulation_output.rmd",
output_file = paste0( output_file = paste0(
stringr::str_remove_all( stringr::str_remove_all(
file,"parameters_|.R$"),"_noheur.html"), file,"parameters_|.R$"),"_twoheur_n3600.html"),
params = list(file=file) params = list(file=file)
) )
......
Version: 1.0
RestoreWorkspace: Default
SaveWorkspace: Default
AlwaysSaveHistory: Default
EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8
RnwWeave: Sweave
LaTeX: pdfLaTeX
--- ---
title: "Simulation experimental design" title: "Simulation experimental design"
author: "" author: ""
date: "2023-01-05" date: "`r format(Sys.time(), '%Y-%m-%d %H:%M:%S')`"
params: params:
file: "Projects/SE_DRIVE/parameters_SE_DRIVE.R" file: "Projects/SE_DRIVE/parameters_SE_DRIVE.R"
format: format:
...@@ -17,7 +17,7 @@ knitr::opts_chunk$set(echo = TRUE) ...@@ -17,7 +17,7 @@ knitr::opts_chunk$set(echo = TRUE)
```{r run_code, message=FALSE, warning=FALSE, include=FALSE, paged.print=FALSE} ```{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() # retrieve the values of the objects starting with "b" using mget()
# b_values <- mget(ls(pattern = "^b")) # b_values <- mget(ls(pattern = "^b"))
...@@ -65,6 +65,12 @@ designs_all <- readRDS("output/330_5000runs_4designs_mixl.RDS") ...@@ -65,6 +65,12 @@ designs_all <- readRDS("output/330_5000runs_4designs_mixl.RDS")
# Statistics and power # Statistics and power
```{r}
cat(notes)
```
Here you see the statistics of your parameters for the `r nosim` runs. Here you see the statistics of your parameters for the `r nosim` runs.
```{r} ```{r}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment