-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathREADME.Rmd
More file actions
85 lines (66 loc) · 3.01 KB
/
README.Rmd
File metadata and controls
85 lines (66 loc) · 3.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
```
[](https://github.com/MarselScheer/simTool/actions)
[](https://app.codecov.io/gh/MarselScheer/simTool/)
[](https://lifecycle.r-lib.org/articles/stages.html)
[](https://www.repostatus.org/#active)
[](https://cran.r-project.org/package=simTool)
[](https://cran.r-project.org/package=simTool)
[](https://www.gnu.org/licenses/gpl-3.0.en.html)
# simTool
An R-Package that facilitates simulation studies. It disengages the researcher from administrative source code.
The *simTool* package is designed for statistical simulations that
have two components. One component generates the data and the other one
analyzes the data. The main aims of the *simTool* package are the reduction
of the administrative source code (mainly loops and management code for the results)
and a simple applicability
of the package that allows the user to quickly learn how to work with the
*simTool* package. Parallel computing is also supported. Finally, convenient
functions are provided to summarize the simulation results.
## Example
This small simulation (using 4 cores) illustrates how the confidence interval based on the
t-distribution performs on exponential distributed random variables. The
following lines generate exponential distributed random variables of size
10, 50, 100, and 1000. Afterwards the *t.test* using confidence levels
0.8, 0.9, 0.95 are applied. This is repeated 1000 times to estimate
the coverage:
```{r example}
library(simTool)
dg <- expand_tibble(fun = "rexp", rate = 10, n = c(10L, 50L, 100L, 1000L))
pg <- expand_tibble(proc = "t.test", conf.level = c(0.8, 0.9, 0.95))
et <- eval_tibbles(dg, pg,
ncpus = 4,
replications = 10^3,
post_analyze = function(ttest) tibble::tibble(
coverage = ttest$conf.int[1] <= 1 / 10 && 1 / 10 <= ttest$conf.int[2]),
summary_fun = list(mean = mean)
)
et
```
## Installation
You can install simTool from github with:
```{r gh-installation, eval = FALSE}
remotes::install_github("MarselScheer/simTool")
```
Or from CRAN with:
```{r cran-installation, eval = FALSE}
install.packages("simTool")
```
## Test suite
With tinytest you can rerun the test for simTool by calling
```{r tinytest, eval = FALSE}
# install.packages("tinytest")
tinytest::test_package("simTool")
```