From 7e3c489c3bfa5d4dcce12a9b1b933f9a408c24ca Mon Sep 17 00:00:00 2001
From: samuelsmock <smock.samuel@gmail.com>
Date: Thu, 25 Jan 2024 15:07:54 +0100
Subject: [PATCH] generic bcoeff unpacking

---
 DESCRIPTION             |  2 +-
 man/sim_all.Rd          | 17 +++++++++++++++--
 man/sim_choice.Rd       |  9 ++++++++-
 man/simulate_choices.Rd |  2 +-
 4 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/DESCRIPTION b/DESCRIPTION
index 260f9bd..470a1e7 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -8,7 +8,7 @@ Description: A package that supports simulating choice experiment data for given
 License: MIT + file LICENSE
 Encoding: UTF-8
 Roxygen: list(markdown = TRUE)
-RoxygenNote: 7.3.0
+RoxygenNote: 7.3.1
 Imports: 
     dplyr (>= 1.1.4),
     evd,
diff --git a/man/sim_all.Rd b/man/sim_all.Rd
index 6d27660..4b5e893 100644
--- a/man/sim_all.Rd
+++ b/man/sim_all.Rd
@@ -2,9 +2,10 @@
 % Please edit documentation in R/sim_all.R
 \name{sim_all}
 \alias{sim_all}
-\title{Is a wrapper for sim_choice executing the simulation over all designs stored in a specific folder}
+\title{Is a wrapper for sim_choice executing the simulation over all designs stored in a specific folder
+update}
 \usage{
-sim_all(nosim = 2, resps, destype = "ngene", designpath, u)
+sim_all(nosim = 2, resps, destype = "ngene", designpath, u, bcoeff)
 }
 \arguments{
 \item{nosim}{Number of runs or simulations. For testing use 2 but once you go serious, use at least 200, for better results use 2000.}
@@ -16,12 +17,15 @@ sim_all(nosim = 2, resps, destype = "ngene", designpath, u)
 \item{designpath}{The path to the folder where the designs are stored. For example "c:/myfancydec/Designs"}
 
 \item{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.}
+
+\item{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}}
 }
 \value{
 A list, with all information on the simulation. This list an be easily processed by the user and in the rmarkdown template.
 }
 \description{
 Is a wrapper for sim_choice executing the simulation over all designs stored in a specific folder
+update
 }
 \examples{
 
@@ -29,4 +33,13 @@ Is a wrapper for sim_choice executing the simulation over all designs stored in
  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)
+
 }
diff --git a/man/sim_choice.Rd b/man/sim_choice.Rd
index 8f40c96..1b6ecbc 100644
--- a/man/sim_choice.Rd
+++ b/man/sim_choice.Rd
@@ -4,7 +4,14 @@
 \alias{sim_choice}
 \title{Title}
 \usage{
-sim_choice(designfile, no_sim = 10, respondents = 330, ut, destype = destype)
+sim_choice(
+  designfile,
+  no_sim = 10,
+  respondents = 330,
+  ut,
+  destype = destype,
+  bcoefficients
+)
 }
 \arguments{
 \item{designfile}{path to a file containing a design.}
diff --git a/man/simulate_choices.Rd b/man/simulate_choices.Rd
index 3a3f85f..17e91e6 100644
--- a/man/simulate_choices.Rd
+++ b/man/simulate_choices.Rd
@@ -4,7 +4,7 @@
 \alias{simulate_choices}
 \title{Simulate choices based on a dataframe with a design}
 \usage{
-simulate_choices(data, utility, setspp, destype)
+simulate_choices(data, utility, setspp, destype, bcoefficients)
 }
 \arguments{
 \item{data}{a dataframe that includes a design repeated for the number of observations}
-- 
GitLab