boxcoxtype {boxcoxmix} | R Documentation |
Box-Cox-type link function for logistic mixed-effects Models
Description
The boxcoxtype()
performs a grid search over the parameter Lambda
for logistic mixed-effects models and then optimizes over this grid,
to calculate the maximum likelihood estimator of the transformation.
Usage
boxcoxtype(
formula,
random = ~1,
k = 3,
trials = 1,
data,
find.in.range = c(-2, 2),
s = 20,
plot.opt = 1,
random.distribution = "np",
...
)
boxcoxpower(Lambda = 0)
binomial(link = boxcoxpower(0))
Arguments
formula |
a formula describing the transformed response and the fixed effect model (e.g. y ~ x). |
random |
a formula defining the random model. Set |
k |
the number of mass points. |
trials |
optional prior weights for the data. For Bernoulli distribution, set trials=1. |
data |
a data frame containing variables used in the fixed and random effect models. |
find.in.range |
search in a range of |
s |
number of points in the grid search of |
plot.opt |
Set |
random.distribution |
the mixing distribution, Gaussian Quadrature (gq) or NPML (np) can be set. |
... |
extra arguments will be ignored. |
Lambda |
the power of the transformation |
link |
the link function to be used. |
Details
The Box-Cox transformation (Box & Cox, 1964) is applied to the
logistic mixed-effects models with an unspecified
mixing distribution. The NPML estimate of the mixing distribution is known
to be a discrete distribution involving a finite number of mass-points and corresponding
masses (Aitkin et al., 2009). An Expectation-Maximization (EM) algorithm is
used for fitting the finite mixture distribution, one needs to specify the
number of components k
of the finite mixture in advance.
This algorithm can be implemented using the npmlreg function alldist
for the logistic-type overdispersion model and the npmlreg function allvc
for the
two-level logistic-type model, setting family = binomial(link = boxcoxpower(Lambda))
where
Lambda
is the value of the power transformation. When k
=1, the npmlreg function alldist()
fits the logistic regression model without random effects.
boxcoxtype()
performs a grid search over the parameter Lambda
and then
optimizes over this grid, to calculate the maximum likelihood estimator of the transformation.
It produces a plot of the profile likelihood function that summarises information
concerning Lambda
, including a vertical line indicating the best value of Lambda
that maximizes the profile log-likelihood.
Value
List with class boxcoxmix
containing:
Maximum |
the best estimate of |
objective |
the value of the profile log-likelihood corresponding to Maximum. |
coef |
the vector of coefficients. |
profile.loglik |
the profile log-likelihood of the fitted regression model. |
fit |
the fitted alldist object from the last EM iteration. |
aic |
the Akaike information criterion of the fitted regression model. |
bic |
the Bayesian information criterion of the fitted regression model. |
The other outcomes are not relevant to users and they are intended for internal use only.
Author(s)
Amani Almohaimeed and Jochen Einbeck
References
Box G. and Cox D. (1964). An analysis of transformations. Journal of the Royal Statistical Society. Series B (Methodological), pages 211-252.
Aitkin, M. A., Francis, B., Hinde, J., and Darnell, R. (2009). Statistical modelling in R. Oxford University Press Oxford.
Jochen Einbeck, Ross Darnell and John Hinde (2014). npmlreg: Nonparametric maximum likelihood estimation for random effect models. R package version 0.46-1.
See Also
np.boxcoxmix
, optim.boxcox
,
tolfind.boxcox
, Kfind.boxcox
.
Examples
#Beta blockers data
data("betablocker", package = "flexmix")
library(npmlreg)
betavc <-allvc(cbind(Deaths, Total - Deaths) ~ Treatment, data = betablocker,random=~1|Center,
k=3,random.distribution='np',family = binomial(link = boxcoxpower(0)))
betavc$disparity
#[1] 318.7211
betavc3 <-boxcoxtype(cbind(Deaths, Total - Deaths) ~ Treatment,random=~1|Center,
data = betablocker, find.in.range = c(-2,0.4),s=40,k=3,random.distribution='np')
#Maximum Profile Log-likelihood: -158.6025 at lambda= -0.56
betavc3$fit$disparity
#[1] 317.2049
betavc3$aic
#[1] 331.2049
betavc3$bic
#[1] 343.6942