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

small changes in manual

parent 929d47df
No related branches found
No related tags found
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,
......
......@@ -9,7 +9,8 @@
#'
#' @examples \dontrun{simulate_choices(datadet, ut,setspp)}
simulate_choices <- function(data, utility, setspp, destype, bcoefficients) { #the part in dataset that needs to be repeated in each run
### unpack the bcoeff list
### unpack the bcoeff list
bsq <- bcoefficients$bsq
bredkite <- bcoefficients$bredkite
bdistance <- bcoefficients$bdistance
......
......@@ -4,7 +4,7 @@
\alias{sim_all}
\title{Is a wrapper for sim_choice executing the simulation over all designs stored in a specific folder}
\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,6 +16,8 @@ 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.
......@@ -29,4 +31,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