| lqmix | R Documentation |
Estimate a finite mixture of linear quantile regression models with TC and/or TV discrete random coefficients, for a given number of components and/or states.
lqmix(formula, randomTC = NULL, randomTV = NULL, group, time, G = NULL,
m = NULL, data, qtl = 0.5, eps = 10^-5, maxit = 1000, se = TRUE,
R = 200, start = 0, parInit = list(betaf = NULL, betarTC = NULL,
betarTV = NULL, pg = NULL, delta = NULL, Gamma = NULL, scale = NULL),
verbose = TRUE, seed = NULL, parallel = FALSE, ncores = 2)
formula |
an object of class |
randomTC |
a one-sided formula of the form |
randomTV |
a one-sided formula of the form |
group |
a string indicating the grouping variable, i.e., the factor identifying the unit longitudinal measurements refer to |
time |
a string indicating the time variable |
G |
number of mixture components associated to TC random coefficients |
m |
number of states associated to TV random coefficients |
data |
a data frame containing the variables named in |
qtl |
quantile to be estimated |
eps |
tolerance level for convergence of the EM algorithm |
maxit |
maximum number of iterations for the EM algorithm |
se |
if set to TRUE, standard error are computed |
R |
number of bootstrap samples for computing standard errors |
start |
type of starting values (0 = deterministic, 1 = random, 2 = initial values in input) |
parInit |
list of initial model parameters when |
verbose |
if set to FALSE, no printed output is given during the function execution |
seed |
an integer value for random numbers generation, used for random parameter initialization and bootstrap standard errors |
parallel |
if set to TRUE, a parallelized code is use for standard error computation (if |
ncores |
number of cores used for computing bootstrap standard errors (if required) |
The function computes ML estimates for a linear quantile mixture model with TC and/or TV random coefficients. Estimates are derived by maximizing the (log-)likelihood of an Asymmetric Laplace regression, where the location parameter is modeled as a function of fixed coefficients, together with TC, TV, or TC and TV discrete random coefficients, as proposed by Alfo' et. al (2017), Farcomeni (2012), and Marino et. al (2018), respectively.
The function requires data in long-format and two additional columns indicating the group identifier and the time occasion.
The model is specified by means of the arguments formula, formulaTC, and formulaTV:
formula is associated to fixed coefficients; formulaTC is associated to TC random coefficients; formulaTV is associated to TV random coefficients.
In this latter, only TC variables (predictors) are allowed.
The function allows for missing data, including dropouts (monotone missing data) and intermittent missingness, under a missing-at-random assumption. Note that, when TV random coefficients are considered, intermittent missingness may cause biased inference.
If se=TRUE, standard errors based on a block bootstrap procedure are computed.
Return an object of class lqmix. This is a list containing the following elements:
betaf |
a vector of fixed regression coefficients |
betarTC |
a matrix of TC random coefficients, if present in the model |
betarTV |
a matrix of TV random coefficients, if present in the model |
pg |
the prior probabilities of the finite mixture associated to TC random coefficients, if present in the model |
delta |
the initial probability vector of the hidden Markov chain associated to TV random coefficients, if present in the model |
Gamma |
the transition probability matrix of the hidden Markov chain associated to TV random coefficients, if present in the model |
scale |
the scale parameter |
sigma.e |
the standard deviation of error terms |
lk |
the log-likelihood at convergence of the EM algorithm |
npar |
the total number of model parameters |
aic |
the AIC value |
bic |
the BIC value |
qtl |
the estimated quantile |
G |
the number of mixture components associated to TC random coefficients (if present) |
m |
the number of hidden states associated to TV random coefficients (if present) |
nsbjs |
the number of subjects (units) |
nobs |
the total number of observations |
se.betaf |
the standard errors for fixed regression coefficients |
se.betarTC |
the standard errors for TC random coefficients, if present in the model |
se.betarTV |
the standard errors for TV random coefficients, if present in the model |
se.Mprob |
the standard errors for the prior probabilities of the finite mixture associated to TC random coefficients, if present in the model |
se.Init |
the standard errors for the initial probabilities of the hidden Markov chain associated to TV random coefficients, if present in the model |
se.Trans |
the standard errors for the transition probabilities of the hidden Markov chain associated to TV random coefficients, if present in the model |
se.scale |
the standard error for the scale parameter |
vcov |
the bootstrap variance-covariance matrices of the regression coefficients |
postTC |
a matrix of size |
postTV |
a matrix of size |
miss |
the missingness type |
model |
the estimated model |
call |
the matched call |
mmf |
the model matrix associated with fixed regression coefficients |
mmrTC |
the model matrix associated with TC random coefficients, if present in the model |
mmrTV |
the model matrix associated with TV random coefficients, if present in the model |
y |
the model response |
formula |
the fixed model formula |
randomTC |
the model formula for the TC random coefficients, if present in the model |
randomTV |
the model formula for the TV random coefficients, if present in the model |
group |
the grouping variable |
time |
the time variable |
ref:lqmixTClqmix
\insertRefref:lqmixTVlqmix
\insertRefref:lqmixTCTVlqmix
outTC = lqmix(formula=meas~trt+time+trt:time,randomTC=~1,
group="id",time="time",G=2,data=pain,se=TRUE,R=10)
outTV = lqmix(formula=meas~trt+time+trt:time,randomTV=~1,
group="id",time="time",m=2,data=pain,R=10)
outTCTV = lqmix(formula=meas~trt+time+trt:time,randomTC=~time,
randomTV=~1,group="id",time="time",m=2,G=2,data=pain,R=10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.