Skip to content
Snippets Groups Projects
Commit 493fa987 authored by dj44vuri's avatar dj44vuri
Browse files

changed readme

parent 008c3298
No related branches found
No related tags found
No related merge requests found
...@@ -19,7 +19,7 @@ knitr::opts_chunk$set( ...@@ -19,7 +19,7 @@ knitr::opts_chunk$set(
<!-- badges: end --> <!-- badges: end -->
The goal of simulateDCE is to make it easy to simulate choice experiment datasets using designs from NGENE or `spdesign`. You have to store the design file in a subfolder and need to specify certain parameters and the utility functions for the data generating process. The package is useful for: The goal of simulateDCE is to make it easy to simulate choice experiment datasets using designs from NGENE, `idefix` or `spdesign`. You have to store the design file(s) in a subfolder and need to specify certain parameters and the utility functions for the data generating process. The package is useful for:
1. Test different designs in terms of statistical power, efficiency and unbiasedness 1. Test different designs in terms of statistical power, efficiency and unbiasedness
...@@ -33,14 +33,23 @@ The goal of simulateDCE is to make it easy to simulate choice experiment dataset ...@@ -33,14 +33,23 @@ The goal of simulateDCE is to make it easy to simulate choice experiment dataset
## Installation ## Installation
You can install the development version of simulateDCE from gitlab. You need to install the `remotes` package first. The current version is alpha and there is no version on cran: You can install simulateDCE from github. You need to install the `devtools` package first. The current version is alpha and there is no version on cran:
``` r ``` r
install.packages("remotes") install.packages("devtools")
remotes::install_gitlab(repo = "dj44vuri/simulateDCE" , host = "https://git.idiv.de") devtools::install_git('https://github.com/sagebiej/simulateDCE', ref = "main")
``` ```
For the latest development version use this:
``` r
install.packages("devtools")
devtools::install_git('https://github.com/sagebiej/simulateDCE', ref = "devel")
```
## Example ## Example
This is a basic example for a simulation: This is a basic example for a simulation:
...@@ -54,12 +63,10 @@ library(rlang) ...@@ -54,12 +63,10 @@ library(rlang)
library(formula.tools) library(formula.tools)
library(rlang)
designpath<- system.file("extdata","SE_DRIVE" ,package = "simulateDCE") designpath<- system.file("extdata","SE_DRIVE" ,package = "simulateDCE")
resps =120 # number of respondents resps =120 # number of respondents
nosim= 2 # number of simulations to run (about 500 is minimum) nosim= 400 # number of simulations to run (about 500 is minimum)
...@@ -107,7 +114,7 @@ ul<-list( u1 = ...@@ -107,7 +114,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, bcoeff = bcoeff) designpath = designpath, u=ul, bcoeff = bcoeff, decisiongroups = decisiongroups)
``` ```
This diff is collapsed.
man/figures/README-example-1.png

53.3 KiB | W: | H:

man/figures/README-example-1.png

53.4 KiB | W: | H:

man/figures/README-example-1.png
man/figures/README-example-1.png
man/figures/README-example-1.png
man/figures/README-example-1.png
  • 2-up
  • Swipe
  • Onion skin
man/figures/README-example-2.png

42.2 KiB | W: | H:

man/figures/README-example-2.png

49.8 KiB | W: | H:

man/figures/README-example-2.png
man/figures/README-example-2.png
man/figures/README-example-2.png
man/figures/README-example-2.png
  • 2-up
  • Swipe
  • Onion skin
man/figures/README-example-3.png

56.1 KiB | W: | H:

man/figures/README-example-3.png

51.7 KiB | W: | H:

man/figures/README-example-3.png
man/figures/README-example-3.png
man/figures/README-example-3.png
man/figures/README-example-3.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -21,9 +21,9 @@ decisiongroups=c(0,0.7,1) ...@@ -21,9 +21,9 @@ decisiongroups=c(0,0.7,1)
# pass beta coefficients as a list # pass beta coefficients as a list
bcoeff <- list( bcoeff <- list(
bpreis = -0.01, b.preis = -0.01,
blade = -0.07, b.lade = -0.07,
bwarte = 0.02) b.warte = 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),
...@@ -36,13 +36,13 @@ manipulations = list(alt1.x2= expr(alt1.x2/10), ...@@ -36,13 +36,13 @@ manipulations = list(alt1.x2= expr(alt1.x2/10),
ul<-list( u1 = ul<-list( u1 =
list( list(
v1 =V.1~ bpreis * alt1.x1 + blade*alt1.x2 + bwarte*alt1.x3 , v1 =V.1~ b.preis * alt1.x1 + b.lade*alt1.x2 + b.warte*alt1.x3 ,
v2 =V.2~ bpreis * alt2.x1 + blade*alt2.x2 + bwarte*alt2.x3 v2 =V.2~ b.preis * alt2.x1 + b.lade*alt2.x2 + b.warte*alt2.x3
) )
, ,
u2 = list( v1 =V.1~ bpreis * alt1.x1 , u2 = list( v1 =V.1~ b.preis * alt1.x1 ,
v2 =V.2~ bpreis * alt2.x1) v2 =V.2~ b.preis * alt2.x1)
) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment