From 929d47dfbfb2c955ebe3f96c3e6d3a1bc42eb3a0 Mon Sep 17 00:00:00 2001
From: Samuel Smock <samuel.smock@idiv.de>
Date: Thu, 25 Jan 2024 11:31:04 +0100
Subject: [PATCH] doc updates for bcoeff in markdown parameter help and
 examples

---
 R/sim_all.R | 10 ++++++++++
 README.Rmd  |  9 +++++----
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/R/sim_all.R b/R/sim_all.R
index cf9bb8e..94830bf 100644
--- a/R/sim_all.R
+++ b/R/sim_all.R
@@ -5,6 +5,7 @@
 #' @param destype Is it a design created with ngene or with spdesign. Ngene desings should be stored as the standard .ngd output. spdesign should be the spdesign object design$design
 #' @param designpath The path to the folder where the designs are stored. For example "c:/myfancydec/Designs"
 #' @param u A list with utility functions. The list can incorporate as many decision rule groups as you want. However, each group must be in a list in this list. If you just use one group (the normal),  this  group still  has to be in a list in  the u list.
+#' @param bcoefficients List of coefficients for the utility function. List content/length can vary based on application, but item names should be in namespace: {bsq, bredkite, bdistance, bcost, bfarm2, bfarm3, bheight2, bheight3}
 #'
 #' @return A list, with all information on the simulation. This list an be easily processed by the user and in the rmarkdown template.
 #' @export
@@ -15,6 +16,15 @@
 #'  resps =240  # number of respondents
 #'  nosim=2 # number of simulations to run (about 500 is minimum)
 #'
+#'  bcoeff <-list(bsq=0.00, # hypothesized beta coefficients for individual terms of the utility function
+#'      bredkite=-0.05,
+#'      bdistance=0.50,
+#'      bcost=-0.05,
+#'      bfarm2=0.25,
+#'      bfarm3=0.50,
+#'      bheight2=0.25,
+#'      bheight3=0.50)
+#'
 sim_all <- function(nosim=2, resps, destype="ngene", designpath, u, bcoeff){
 
 
diff --git a/README.Rmd b/README.Rmd
index bb8f0c1..2c8baae 100644
--- a/README.Rmd
+++ b/README.Rmd
@@ -76,9 +76,10 @@ decisiongroups=c(0,0.7,1)
 # wrong parameters
 
 #
-bpreis = -0.01
-blade = -0.07
-bwarte = 0.02
+bcoeff  = list(
+  bpreis = -0.01,
+  blade = -0.07,
+  bwarte = 0.02)
 
 manipulations = list(alt1.x2=     expr(alt1.x2/10),
                      alt1.x3=     expr(alt1.x3/10),
@@ -105,7 +106,7 @@ ul<-list( u1 =
 destype="ngene"
 
 sedrive <- sim_all(nosim = nosim, resps=resps, destype = destype,
-                   designpath = designpath, u=ul)
+                   designpath = designpath, u=ul, bcoeff = bcoeff)
 
 
 ```
-- 
GitLab