diff --git a/Projects/feedadditives/parameters_feedadd.R b/Projects/feedadditives/parameters_feedadd.R index bb961434e1227fa53bd57e64973f586b7410a7ad..c28ef2614a840942e21e0df06362a4272c2d81a7 100644 --- a/Projects/feedadditives/parameters_feedadd.R +++ b/Projects/feedadditives/parameters_feedadd.R @@ -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") + diff --git a/Projects/feedadditives/parameters_feedadd_heur.R b/Projects/feedadditives/parameters_feedadd_heur.R new file mode 100644 index 0000000000000000000000000000000000000000..7a727b83839f00bd14a9c543d8f64757a047069a --- /dev/null +++ b/Projects/feedadditives/parameters_feedadd_heur.R @@ -0,0 +1,46 @@ + + +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) + + + +) diff --git a/generatemd.R b/generatemd.R index 32ab29f402e9e764bd0ebc6952c63a29bbbed554..d75b58b50279a6c0c2bb36b4b324bb82549eeb8a 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$"),"_twoheur_n3600.html"), + file,"parameters_|.R$"),"_alldesN240.html"), params = list(file=file) )