gcmr(formula, data, subset, offset, contrasts=NULL,
marginal, cormat, start, fixed, options=gcmr.options())gcmr.fit(x=rep(1,NROW(y)), y, z=NULL, offset=NULL,
marginal, cormat, start, fixed, options=gcmr.options())
y ~ x or
y ~ x | z, for details see below.as.data.frame to a data frame) containing the variables in the model. If not found in data, the variables are taken frcontrasts.arg of model.matrix.default.n * p.n.n * p.marginal.gcmr specifying the marginal part of the model.cormat.gcmr representing the correlation matrix of the errors.NA entries in fixed will be varied.gcmr.options."gcmr" with the following components:gcmr.options.coefficients, logLik, fitted, vcov.gcmr, se 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.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.
Masarotto, G. and Varin, C. (2012). Gaussian copula marginal regression. Electronic Journal of Statistics 6, 1517--1549.
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.
cormat.gcmr, marginal.gcmr, gcmr.options, Formula, betareg.## 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))Run the code above in your browser using DataLab