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

with final changes on feedadd project

parent 8dafddbd
Branches
Tags
No related merge requests found
......@@ -2,35 +2,51 @@
designpath<- "Projects/feedadditives/Designs/"
notes <- "This design consists of different heuristics. One group did not attend the methan attribute, another group only decided based on the payment"
#notes <- "This design consists of different heuristics. One group did not attend the methan attribute, another group only decided based on the payment"
notes <- "No Heuristics, price logarithmized after recoded to original level. methane continious"
resps =3600 # number of respondents
nosim=2 # number of simulations to run (about 500 is minimum)
resps =240 # number of respondents
nosim=500 # number of simulations to run (about 500 is minimum)
#betacoefficients should not include "-"
basc = 0.2
bcow = 0.3
badv = 0.3
bvet = 0.3
bfar = 0.3
bmet = 0.3
bcow = 0.2
badv = 0.2
bvet = 0.2
bfar = 0.2
bmet = 0.1
bbon = 0.3
bbon2 = 1.9
bcowXvet =0.1
manipulations = list(alt1.bon= expr(alt1.bon*5),
alt2.bon= expr(alt2.bon*5),
alt1.lnbon = expr(if_else(alt1.bon==0,0,log(alt1.bon))),
alt2.lnbon = expr(if_else(alt2.bon==0,0,log(alt2.bon)))
)
decisiongroups=c(0,0.6,0.8,1)
#place your utility functions here
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) ,
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)
v1 =V.1 ~ bcow*alt1.cow + badv * alt1.adv + bvet * alt1.vet + bfar * alt1.far + bmet*alt1.met + bbon * alt1.lnbon + bcowXvet*alt1.cow*alt1.vet,
v2 =V.2 ~ bcow*alt2.cow + badv * alt2.adv + bvet * alt2.vet + bfar * alt2.far + bmet*alt2.met + bbon * alt2.lnbon + bcowXvet*alt2.cow*alt2.vet,
v3 =V.3 ~ basc)
)
## logBonus
beta_ln = 0.3
bon <- c(1,5,10,15,20,25,30,35)
lnbon<-log(bon)
U=beta_ln*lnbon
plot(bon,U, type = "l")
designpath<- "Projects/feedadditives/Designs/"
#notes <- "This design consists of different heuristics. One group did not attend the methan attribute, another group only decided based on the payment"
notes <- "Three heuristics"
resps =300 # number of respondents
nosim=2 # number of simulations to run (about 500 is minimum)
#betacoefficients should not include "-"
basc = 0.2
bcow = 0.3
badv = 0.3
bvet = 0.3
bfar = 0.3
bmet = 0.3
bbon = 0.3
bbon2 = 1.9
basc2 =2
decisiongroups=c(0,0.3,0.6,0.8,1)
#place your utility functions here
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)
,
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),
u4 = list(v1 =V.1 ~ basc2 + 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)
)
......@@ -8,7 +8,7 @@ rm(list=ls())
rmarkdown::render("simulation_output.rmd",
output_file = paste0(
stringr::str_remove_all(
file,"parameters_|.R$"),"_twoheur_n3600.html"),
file,"parameters_|.R$"),"_alldesN240.html"),
params = list(file=file)
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment