Skip to content

Commit 75b5d8d

Browse files
committed
Adding copula links to vignette
1 parent b31941a commit 75b5d8d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

vignettes/correlated.Rmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ ggtheme <- function(panelback = "white") {
4040

4141
## Correlated data
4242

43-
Sometimes it is desirable to simulate correlated data from a correlation matrix directly. For example, a simulation might require two random effects (e.g. a random intercept and a random slope). Correlated data like this could be generated using the `defData` functionality, but it may be more natural to do this with `genCorData` or `addCorData`. Currently, simstudy can only generate multivariate normal using these functions. (In the future, additional distributions will be available.)
43+
Sometimes it is desirable to simulate correlated data from a correlation matrix directly. For example, a simulation might require two random effects (e.g. a random intercept and a random slope). Correlated data like this could be generated using the `defData` functionality, but it may be more natural to do this with `genCorData` or `addCorData`. Currently, simstudy can only generate multivariate normal using these functions.
4444

4545
`genCorData` requires the user to specify a mean vector `mu`, a single standard deviation or a vector of standard deviations `sigma`, and either a correlation matrix `corMatrix` or a correlation coefficient `rho` and a correlation structure `corsrt`. Here are a few examples:
4646

@@ -103,7 +103,7 @@ dt[,round(sqrt(diag(var(cbind(a0, a1)))),1)]
103103

104104
Two additional functions facilitate the generation of correlated data from *binomial*, *poisson*, *gamma*, and *uniform* distributions: `genCorGen` and `addCorGen`.
105105

106-
`genCorGen` is an extension of `genCorData`. In the first example, we are generating data from a multivariate Poisson distribution. We start by specifying the mean of the Poisson distribution for each new variable, and then we specify the correlation structure, just as we did with the normal distribution.
106+
`genCorGen` is an extension of `genCorData`. These functions draw on copula-based methods to generate the data. (This [Wikipedia page](https://bit.ly/31vAxFf) provides a general introduction and copula-based modeling can be conducted in `R` using package [copula](https://cran.r-project.org/web/packages/copula/index.html).) In the first example, we are generating data from a multivariate Poisson distribution. We start by specifying the mean of the Poisson distribution for each new variable, and then we specify the correlation structure, just as we did with the normal distribution.
107107

108108
```{r}
109109
l <- c(8, 10, 12) # lambda for each new variable

0 commit comments

Comments
 (0)