Fits Gaussian copula marginal regression models by maximum (simulated) likelihood.

1 2 3 4 5 |

`formula` |
a symbolic description of the model to be fitted of type |

`data` |
an optional data frame, list or environment (or object coercible by |

`subset` |
an optional vector specifying a subset of observations to be used in the fitting process. |

`offset` |
optional numeric vector with an a priori known component to be included in the linear predictor for the mean. When appropriate, offset may also be a list of two offsets for the mean and precision equation, respectively. |

`x` |
design matrix. |

`y` |
vector of observations. |

`z` |
optional design matrix for the dispersion/shape. |

`marginal` |
an object of class |

`cormat` |
an object of class |

`start` |
optional numeric vector with starting values for the model parameters. |

`fixed` |
optional numeric vector of the same length as the total number of parameters. If supplied, only |

`options` |
list of options passed to function |

`model` |
logical. If |

`...` |
arguments passed to |

Function `gcmr`

computes maximum likelihood estimation in Gaussian copula marginal regression models. Computation of the exact likelihood is possible only for continuous responses, otherwise the likelihood function is approximated by importance sampling. See Masarotto and Varin (2012) for details.

Standard formula `y ~ x1 + x2`

indicates that the mean response is modelled as a function of covariates `x1`

and `x2`

through an appropriate link function. Extended formula `y ~ x1 + x2 | z1 + z2`

indicates that the dispersion (or the shape) parameter of the marginal distribution is modelled as a function of covariates `z1`

and `z2`

. Dispersion (or shape) parameters are always modelled on logarithm scale. The model specification is inspired by beta regression as implemented in `betareg`

(Cribari-Neto and Zeileis, 2010) through extended `Formula`

objects (Zeileis and Croissant, 2010).

For binomial marginals specified by `binomial.marg`

the response is specified as a factor when the first level denotes failure and all others success or as a two-column matrix with the columns giving the numbers of successes and failures.

`gcmr.fit`

is the workhorse function: it is not normally called directly but can be more efficient where the response vector and design matrix have already been calculated.

An object of class `"gcmr"`

with the following components:

`estimate` |
the maximum likelihood estimate. |

`maximum` |
the maximum likelihood value. |

`hessian` |
(minus) the Hessian at the maximum likelihood estimate. |

`jac` |
the Jacobian at the maximum likelihood estimate. |

`fitted.values` |
the fitted values. |

`marginal` |
the marginal model used. |

`cormat` |
the correlation matrix used. |

`fixed` |
the numeric vector indicating which parameters are constants. |

`ibeta` |
the indices of marginal parameters. |

`igamma` |
the indices of dependence parameters. |

`nbeta` |
the number of marginal parameters. |

`ngamma` |
the number of dependence parameters. |

`options` |
the fitting options used, see |

`call` |
the matched call. |

`formula` |
the model formula. |

`terms` |
the terms objects for the fitted model. |

`levels` |
the levels of the categorical regressors. |

`model` |
the model frame, returned only if |

`contrasts` |
the contrasts corresponding to |

`y` |
the y vector used. |

`x` |
the model matrix used for the mean response. |

`z` |
the (optional) model matrix used for the dispersion/shape. |

`offset` |
the offset used. |

`n` |
the number of observations. |

`not.na` |
the vector of binary indicators of the available observations (not missing). |

Functions `coefficients`

, `logLik`

, `fitted`

, `vcov.gcmr`

and `residuals.gcmr`

can be used to extract various useful features of the value returned by `gcmr`

. Function `plot.gcmr`

produces various diagnostic plots for fitted `gcmr`

objects.

Guido Masarotto and Cristiano Varin.

Cribari-Neto, F. and Zeileis, A. (2010). Beta regression in R. *Journal of Statistical Software* **34**, 1–24. http://www.jstatsoft.org/v34/i02/.

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

Rocha, A.V. and Cribari-Neto, F. (2009). Beta autoregressive moving average models. *Test* **18**, 529–545.

Zeileis, A. and Croissant, Y. (2010). Extended model formulas in R: Multiple parts and multiple responses. *Journal of Statistical Software* **34**, 1–13. http://www.jstatsoft.org/v34/i01/.

`cormat.gcmr`

, `marginal.gcmr`

, `gcmr.options`

, `Formula`

, `betareg`

.

1 2 3 4 5 6 7 8 9 10 | ```
## negative binomial model for longitudinal data
data(epilepsy)
gcmr(counts ~ offset(log(time)) + visit + trt + visit:trt, data = epilepsy,
subset = (id != 49), marginal = negbin.marg, cormat = cluster.cormat(id, "ar1"),
options=gcmr.options(seed=123, nrep=100 ))
## Hidden Unemployment Rate (HUR) data (Rocha and Cribari-Neto, 2009)
## beta regression with ARMA(1,3) errors
data(HUR)
trend <- scale(time(HUR))
gcmr(HUR ~ trend | trend, marginal = beta.marg, cormat = arma.cormat(1, 3))
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

All documentation is copyright its authors; we didn't write any of that.