Skip to content

Commit

Permalink
Added library() commands
Browse files Browse the repository at this point in the history
  • Loading branch information
ingorohlfing committed Feb 13, 2020
1 parent 05c63ab commit 5f73600
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions vignettes/Introduction.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ vignette: >
%\VignetteEncoding{UTF-8}
---

```{r, include = F}
library(devtools)
devtools::load_all()
```

## Introduction

The `R` package `qcapower` allows you to estimate power with regard to the consistency of a term generated in a Qualitative Comparative Analysis (QCA). Power is defined in the usual way as the probability of rejecting the null hypothesis when it is false. This vignette introduces the package, its in-built functions and what you can do with the functions' output. The package includes four functions:
Expand Down Expand Up @@ -47,11 +52,12 @@ The role of the simulations and permutations is explained in the manuscript on w

These processes are repeated until the consistency score of the dataset achieves the target value of `alt_hypo`. Because we do not constrain fuzzy-set memberships to two decimal places, it is unlikely that the iterative process does exactly meet the target score. For this reason, we introduce a tolerance parameter telling the `qcapower()` function when the actual consistency value is sufficiently close to the intended value and the iteration can be stopped. If one wants to exactly hit the target consistency level, one only has to set `cons_threshold` to 0.

```{r}
devtools::load_all()
```{r, include = F}
library(qcapower)
library(ggplot2)
library(ggforce)
```


If you want to leave the default parameters as they are, you can, for example, estimate power for H1=1, H0=0.85 and n=15 with one line. The execution of `qcapower()` can take some time, depending on the settings for `cases`, `perms` and `sims`. We load simulation results into the memory that one would get from the first line in the following code block.
```{r qcapower example, eval = c(2, 3)}
power_example <- qcapower(cases = 15, alt_hypo = 1, null_hypo = 0.85)
Expand Down Expand Up @@ -115,7 +121,9 @@ The simulation has to start with a given number of cases (`start_value`). The de
qp_cases_brute(power_target = 0.9, null_hypo = 0.80, alt_hypo = 1)
```

### Packages used in this vignette
Packages used in this vignette and references
----------

- base (R Core Team 2019)
- ggforce (Lin Pedersen 2019)
- ggplot2 (Wickham 2016)
Expand All @@ -124,9 +132,6 @@ qp_cases_brute(power_target = 0.9, null_hypo = 0.80, alt_hypo = 1)
- usethis (Wickham and Bryan 2019)
- devtools (Wickham, Hester, and Chang 2019)

References
----------

Pedersen, Thomas Lin. 2019. *ggforce: Accelerating 'ggplot2'.* R package version 0.3.1.
<https://CRAN.R-project.org/package=ggforce>

Expand Down

0 comments on commit 5f73600

Please sign in to comment.