This is the same code, but wrapped in a package, and provides examples
# Introduction
# Introduction
This projects supports you in simulating data from discrete choice experiments. You can use the code to assess your own designs in terms of efficiency and unbiasedness. You can also investigate the statistical power of the design for given sample size. If you use the code as is, the output is an .html file, rendered with Rmarkdown.
This projects supports you in simulating data from discrete choice experiments. You can use the code to assess your own designs in terms of efficiency and unbiasedness. You can also investigate the statistical power of the design for given sample size. If you use the code as is, the output is an .html file, rendered with Rmarkdown.
# Installation
# Installation
...
@@ -8,13 +16,11 @@ The easiest way is to clone the project to your local machine. You can do that e
...
@@ -8,13 +16,11 @@ The easiest way is to clone the project to your local machine. You can do that e
# Getting started
# Getting started
Once you have cloned the project, you should browse to the folder "/Projects" and make a new folder for your own project. Here, you can store everything that is specific to your project. You then need to copy the designs you want to use in the simulation to a subfolder e.g. "/Designs". This folder should not contain any other files. Currently, only ".ngd" files are supported. Ideally, you create your designs in NGENE and then store the NGENE output file directly in this folder. Do not modify the ".ngd" file.
Once you have cloned the project, you should browse to the folder "/Projects" and make a new folder for your own project. Here, you can store everything that is specific to your project. You then need to copy the designs you want to use in the simulation to a subfolder e.g. "/Designs". This folder should not contain any other files. Currently, only ".ngd" files are supported. Ideally, you create your designs in NGENE and then store the NGENE output file directly in this folder. Do not modify the ".ngd" file. Additionally, create a new file which you call "parameters_yourname.R". In this file, you put everything that is specific to your simulation, including utility functions and parameters of the function, number of respondents you want to simulate and number of repetitions (runs). Have a look at the example projects (SE_AGRI and SE_DRIVE for simple examples) to get a clear idea what you need. For more complicated simulations, you have to put everything that you need to read in and modify in the "parameters_yourname.R". Have a look at "IPII" and "ValuGaps" for advanced examples
Additionally, create a new file which you call "parameters_yourname.R". In this file, you put everything that is specific to your simulation, including utility functions and parameters of the function, number of respondents you want to simulate and number of repetitions (runs). Have a look at the example projects (SE_AGRI and SE_DRIVE for simple examples) to get a clear idea what you need.
For more complicated simulations, you have to put everything that you need to read in and modify in the "parameters_yourname.R". Have a look at "IPII" and "ValuGaps" for advanced examples
# Running the simulation
# Running the simulation
The next step is to open the file "generatemd.R". Just change the path to the "parameters_yourname.R" file and source the file. If you have many runs, source it as a local job. A large number of runs requires a lot of time to run. Be aware of that.
The next step is to open the file "generatemd.R". Just change the path to the "parameters_yourname.R" file and source the file. If you have many runs, source it as a local job. A large number of runs requires a lot of time to run. Be aware of that.