Learn R Programming

qrLMM (version 2.3)

QRLMM: Quantile Regression for Linear Mixed-Effects Models

Description

Performs a quantile regression for a LMEM using the Stochastic-Approximation of the EM Algorithm (SAEM) for an unique or a set of quantiles.

Usage

QRLMM(y,x,z,groups,p=0.5,precision=0.0001,MaxIter=300,M=10,cp=0.25,
      beta=NA,sigma=NA,Psi=NA,show.convergence=TRUE,CI=95)

Value

The function returns a list with two objects

conv

A two elements list with the matrices teta and se containing the point estimates and standard error estimate for all parameters along all iterations.

The second element of the list is res, a list of 12 elements detailed as

iter

number of iterations.

criteria

attained criteria value.

beta

fixed effects estimates.

weights

random effects weights (\(b_i\)).

sigma

scale parameter estimate for the error term.

Psi

Random effects variance-covariance estimate matrix.

SE

Standard Error estimates.

table

Table containing the inference for the fixed effects parameters.

loglik

Log-likelihood value.

AIC

Akaike information criterion.

BIC

Bayesian information criterion.

HQ

Hannan-Quinn information criterion.

time

processing time.

Arguments

y

the response vector of dimension \(N\) where \(N\) is the total of observations.

x

design matrix for the fixed effects of dimension \(N x d\) where \(d\) represents the number of fixed effects including the intercept, if considered.

z

design matrix for the random effects of dimension \(N x q\) where \(q\) represents the number of random effects.

groups

factor of dimension \(N\) specifying the partitions of the data over which the random effects vary.

p

unique quantile or a set of quantiles related to the quantile regression.

precision

the convergence maximum error.

MaxIter

the maximum number of iterations of the SAEM algorithm. Default = 300.

M

Number of Monte Carlo simulations used by the SAEM Algorithm. Default = 10. For more accuracy we suggest to use M=20.

cp

cut point \((0 \le cp \le 1)\) which determines the percentage of initial iterations with no memory.

beta

fixed effects vector of initial parameters, if desired.

sigma

dispersion initial parameter for the error term, if desired.

Psi

Variance-covariance random effects matrix of initial parameters, if desired.

show.convergence

if TRUE, it will show a graphical summary for the convergence of the estimates of all parameters for each quantile in order to assess the convergence.

CI

Confidence to be used for the Confidence Interval when a grid of quantiles is provided. Default=95.

Author

Christian E. Galarza <cgalarza88@gmail.com> and Victor H. Lachos <hlachos@ime.unicamp.br>

Details

This function considers a linear mixed-effects model defined as:

$$y_i = x_i*\beta_p + z_i*b_i + \epsilon_i;$$

where, \(x_i\) and \(z_i\) are the design matrices for the fixed and random effects respectively, \(\beta_p\) are the fixed effects (associated to the \(p\)-th quantile), \(b_i\) are the random (normal) effects and \(\epsilon_i\) is a random error (considered to be asymmetric Laplace).

This algorithm performs the SAEM algorithm proposed by Delyon et al. (1999), a stochastic version of the usual EM Algorithm deriving exact maximum likelihood estimates of the fixed-effects and variance components.

If the initial parameters are not provided, by default, the fixed effects parameter \(\beta\) and dispersion parameter \(\sigma\) will be the maximum Likelihood Estimates for an Asymmetric Laplace Distribution (obviating the random term). See Yu & Zhang (2005).

When a grid of quantiles is provided, a graphical summary with point estimates and Confidence Intervals for model parameters is shown and also a graphical summary for the convergence of these estimates (for each quantile), if show.convergence=TRUE.

If the convergence graphical summary shows that convergence has not be attained, it's suggested to increase M to 20, to increase the total number of iterations MaxIter to 500 or both.

About the cut point parameter cp, a number between 0 and 1 \((0 \le cp \le 1)\) will assure an initial convergence in distribution to a solution neighborhood for the first cp*MaxIter iterations and an almost sure convergence for the rest of the iterations. If you do not know how SAEM algorithm works, this parameter SHOULD NOT be changed.

This program uses progress bars that will close when the algorithm ends. They must not be closed before if not the algorithm will stop.

References

Delyon, B., Lavielle, M. & Moulines, E. (1999). Convergence of a stochastic approximation version of the EM algorithm. Annals of Statistics, pages 94-128.

Yu, K., & Zhang, J. (2005). A three-parameter asymmetric Laplace distribution and its extension. Communications in Statistics-Theory and Methods, 34(9-10), 1867-1879.

See Also

Orthodont, Cholesterol,QRNLMM