# cluster.cormat

##### Longitudinal/Clustered Data Correlation

Sets longitudinal/clustered data correlation in Gaussian copula regression models.

- Keywords
- regression, nonlinear

##### Usage

```
cluster.cormat(id, type = c("independence", "ar1", "ma1",
"exchangeable", "unstructured"))
```

##### Arguments

- id
subject id. This is a vector of the same lenght of the number of observations. Please note that data must be sorted in way that observations from the same cluster are contiguous.

- type
a character string specifying the correlation structure. At the moment, the following are implemented:

`independence`

working independence. `ar1`

autoregressive of order 1. `ma1`

moving average of order 1. `exchangeable`

exchangeable.

##### Details

The correlation matrices are inherited from the `nlme`

package (Pinheiro and Bates, 2000).

##### Value

An object of class `cormat.gcmr`

representing a correlation matrix for longitudinal or clustered data.

##### References

Masarotto, G. and Varin, C. (2012). Gaussian copula marginal regression. *Electronic Journal of Statistics* **6**, 1517--1549. http://projecteuclid.org/euclid.ejs/1346421603.

Masarotto, G. and Varin C. (2017). Gaussian Copula Regression in R. *Journal of Statistical Software*, **77**(8), 1--26. 10.18637/jss.v077.i08.

Pinheiro, J.C. and Bates, D.M. (2000). *Mixed-Effects Models in S and S-PLUS*. Springer.

##### See Also

*Documentation reproduced from package gcmr, version 1.0.2, License: GPL (>= 2)*