simplexreg(formula, data, subset, na.action, link = c("logit", "probit", "cloglog", "neglog"), corr = "Ind", id = NULL, control = simplexreg.control(...), model = TRUE, y = TRUE, x = TRUE, ...)
simplexreg.fit(y, x, z = NULL, t = NULL, link = "logit", corr = "Ind", id = NULL, control = simplexreg.control())
formula
and id
.model.frame
"logit"
(logit function),
"probit"
(probit function), "cloglog"
(complementary log-log function),
"neglog"
(negative log function) are supported. "Ind"
(independent structure),
"Exc"
(exchangeability) and "AR1"
(AR(1)), see Detailsgee = TRUE
. The length of id
should be the same as the number of observations. y
, x
, z
, t
are
assumed to be sorted in accordance with clusters specified by id
simplexreg.control
simplexreg
:logical values indicating whether response vector
and covariates modelling the mean parameter should be returned as components of the
returned value
For simplexreg.fit
:x
is the design matrix and y
is the response vectorsimplexreg.control
simplex
. The mean and
dispersion parameters are linked to set of regressors. Regression analysis of the simplex model
is implemented in simplexreg
. If corr = "Ind"
, simplex generalized regression model
is employed. Estimations is performed by maximum likelihood via Fisher scoring technique. Apart from including generalized simplex regression models, this function also provides users with generalized estimating equations (GEE) techniques to model longitudinal proportional response. Exchangeability and AR(1) structures are available. Parameter estimation and residual analysis are involved.
We employ the specification approach designed in the fitting model function betareg
of
beta regression in the package betareg. As for simplex regression models, assuming the dispersion
is homogeneous, the response is linked to a linear predictor described by y ~ x1 + x2
using a link
function. Four types of function are available linking the regressors to the mean. However, for dispersion,
the link
function is restricted to logarithm function. When modeling dispersion, the regressor
modelling the dispersion parameter should be specified in a formula form of type y ~ x1 + x2 | z1 + z2
where z1
and z2
are linked to the dispersion parameter $\sigma^2$.
Model specification is a bit complicated when it comes to modelling longitudinal proportional response.
Song et. al (2004) proposed a marginal simplex model consists of three components, the
population-average effects, the pattern of dispersion and the correlation structure. Let the percentage
responses for the $i$th subject be $y_{ij}$, observed at time $t_{ij}$. If corr = "AR1"
,
the working covariance matrix of $y_{ij}$,
$j = 1, 2, ..., n_i$, is
$${\exp(\alpha * |t_{ik} - t_{ij}|)}_{kj}$$
where $\alpha < 0$ and $exp(\alpha)$ is the lag-1 autocorrelation. If
corr = "Exc"
, the covariance matrix will be $(1 - exp(\alpha)) I + exp(\alpha) 1$
where I is the identity matrix while 1 the matrix with all elements being equal to one.
For homogeneous dispersion, the formula is supposed to be of the form y ~ x1 + x2 | 1 | t
where $t$ is the
time covariate. Otherwise, the formula will be of the form y ~ x1 + x2 | z1 + z2 | t
.
simplex
# GLM models
data("sdac", package = "simplexreg")
sim.glm1 <- simplexreg(rcd~ageadj+chemo, link = "logit",
data = sdac)
sim.glm2 <- simplexreg(rcd~ageadj+chemo|age, link = "logit",
data = sdac)
# GEE models
data("retinal", package = "simplexreg")
sim.gee1 <- simplexreg(Gas~LogT+LogT2+Level|1|Time, link = "logit",
corr = "Exc", id = ID, data = retinal)
sim.gee2 <- simplexreg(Gas~LogT+LogT2+Level|LogT+Level|Time,
link = "logit", corr = "AR1", id = ID, data = retinal)
Run the code above in your browser using DataLab