Skip to content
Snippets Groups Projects
Commit 7e3c489c authored by samuelsmock's avatar samuelsmock
Browse files

generic bcoeff unpacking

parent c8d3d26f
Branches
Tags
No related merge requests found
......@@ -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,
......
......@@ -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)
}
......@@ -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.}
......
......@@ -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}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment