Select Git revision
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
sim_all.Rd 2.99 KiB
% Generated by roxygen2: do not edit by hand
% 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
update}
\usage{
sim_all(
nosim = 2,
resps,
destype = NULL,
designpath,
u,
bcoeff,
decisiongroups = c(0, 1),
manipulations = list(),
estimate = TRUE,
chunks = 1,
utility_transform_type = "simple"
)
}
\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.}
\item{resps}{Number of respondents you want to simulate}
\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. As a convention name beta coefficients starting with a lower case "b"}
\item{bcoeff}{List of initial coefficients for the utility function. List content/length can vary based on application, but should all begin with b and be the same as those entered in the utility functions}
\item{decisiongroups}{A vector showing how decision groups are numerically distributed}
\item{manipulations}{A variable to alter terms of the utility functions examples may be applying a factor or applying changes to terms selectively for different groups}
\item{estimate}{If TRUE models will be estimated. If false only a dataset will be simulated. Default is true}
\item{chunks}{The number of chunks determines how often results should be stored on disk as a safety measure to not loose simulations if models have already been estimated. For example, if no_sim is 100 and chunks = 2, the data will be saved on disk after 50 and after 100 runs.}
\item{utility_transform_type}{How the utility function you entered is transformed to the utility function required for mixl. You can use the classic way (simple) where parameters have to start with "b" and variables with "alt" or the more flexible (but potentially error prone) way (exact) where parameters and variables are matched exactly what how the are called in the dataset and in the bcoeff list. Default is "simple". In the long run, simple will be deleted, as exact should be downwards compatible.}
}
\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{
designpath<- system.file("extdata","Rbook" ,package = "simulateDCE")
resps =240 # number of respondents
nosim=2 # number of simulations to run (about 500 is minimum)
bcoeff <-list(bsq=0.00,
bredkite=-0.05,
bdistance=0.50,
bcost=-0.05,
bfarm2=0.25,
bfarm3=0.50,
bheight2=0.25,
bheight3=0.50)
}