Skip to content
Snippets Groups Projects
Commit 929d47df authored by Samuel Smock's avatar Samuel Smock
Browse files

doc updates for bcoeff in markdown parameter help and examples

parent fb85ffb7
No related branches found
No related tags found
No related merge requests found
...@@ -5,6 +5,7 @@ ...@@ -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 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 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 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. #' @return A list, with all information on the simulation. This list an be easily processed by the user and in the rmarkdown template.
#' @export #' @export
...@@ -15,6 +16,15 @@ ...@@ -15,6 +16,15 @@
#' resps =240 # number of respondents #' resps =240 # number of respondents
#' nosim=2 # number of simulations to run (about 500 is minimum) #' 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){ sim_all <- function(nosim=2, resps, destype="ngene", designpath, u, bcoeff){
......
...@@ -76,9 +76,10 @@ decisiongroups=c(0,0.7,1) ...@@ -76,9 +76,10 @@ decisiongroups=c(0,0.7,1)
# wrong parameters # wrong parameters
# #
bpreis = -0.01 bcoeff = list(
blade = -0.07 bpreis = -0.01,
bwarte = 0.02 blade = -0.07,
bwarte = 0.02)
manipulations = list(alt1.x2= expr(alt1.x2/10), manipulations = list(alt1.x2= expr(alt1.x2/10),
alt1.x3= expr(alt1.x3/10), alt1.x3= expr(alt1.x3/10),
...@@ -105,7 +106,7 @@ ul<-list( u1 = ...@@ -105,7 +106,7 @@ ul<-list( u1 =
destype="ngene" destype="ngene"
sedrive <- sim_all(nosim = nosim, resps=resps, destype = destype, sedrive <- sim_all(nosim = nosim, resps=resps, destype = destype,
designpath = designpath, u=ul) designpath = designpath, u=ul, bcoeff = bcoeff)
``` ```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment