ARpLMEC (version 1.0)

ARpLMEC.est: Autoregressive Censored Linear Mixed Effects Models

Description

This function fits left, right or interval censored mixed-effects linear model, with autoregressive errors of order p, using the EM algorithm. It returns estimates, standard errors and prediction of future observations.

Usage

ARpLMEC.est(y, x, z, cc, nj, Arp = 1, beta0 = NULL, sigma0 = NULL,
  D0 = NULL, pi0 = NULL, cens.type = "left", LI = NULL,
  LS = NULL, MaxIter = 200, error = 1e-04, Prev = FALSE,
  step = NULL, isubj = NULL, xpre = NULL, zpre = NULL)

Arguments

y

Vector 1 x n of censored responses, where n is the sum of the number of observations of each individual.

x

Design matrix of the fixed effects of order n x s, corresponding to vector of fixed effects.

z

Design matrix of the random effects of ordern x b, corresponding to vector of random effects.

cc

Vector of censoring indicators of length n, where n is the total of observations. For each observation: 0 if non-censored, 1 if censored.

nj

Vector 1 x m with the number of observations for each subject, where m is the total number of individuals.

Arp

Order of the autoregressive process. Must be a positive integer value. To consider a model uncorrelated use UNC.

beta0

Initial values for the vector of fixed effects. If it is not indicated it will be provided automatically. Default is NULL.

sigma0

Initial values for sigma. If it is not indicated it will be provided automatically. Default is NULL.

D0

Initial values for the covariance matrix for the random effects. If it is not indicated it will be provided automatically. Default is NULL.

pi0

Initial values for the vector for autoregressive coefficients pi's. If it is not indicated it will be provided automatically. Default is NULL.

cens.type

left for left censoring, right for right censoring and interval for interval censoring. Default is left.

LI

Vector censoring lower limit indicator of length n. For each observation: 0 if non-censored, -inf if censored. It is only indicated for when cens.type is both. Default is NULL.

LS

Vector censoring upper limit indicator of length n. For each observation: 0 if non-censored, inf if censored.It is only indicated for when cens.type is both. Default is NULL.

MaxIter

The maximum number of iterations of the EM algorithm. Default is 200.

error

The convergence maximum error. Default is 0.0001.

Prev

Indicator of the prediction process. Default is FALSE.

step

Number of steps for prediction. Default is NULL.

isubj

Vector indicator of subject included in the prediction process. Default is NULL.

xpre

Design matrix of the fixed effects to be predicted. Default is NULL.

zpre

Design matrix of the random effects to be predicted. Default is NULL.

Value

returns list of class “ARpMMEC”:

FixEffect

Data frame with: estimate, standars erros and confidence intervals of the fixed effects.

Sigma2

Data frame with: estimate, standars erros and confidence intervals of the variance of the white noise process.

Phi

Data frame with: estimate, standars erros and confidence intervals of the autoregressive parameters.

RnEffect

Data frame with: estimate, standars erros and confidence intervals of the random effects.

Est

Vector of parameters estimate (fixed Effects, sigma2, phi, random effects).

SE

Vector of the standard errors of (fixed Effects, sigma2, phi, random effects).

loglik

Log-likelihood value.

AIC

Akaike information criterion.

BIC

Bayesian information criterion.

AICc

Corrected Akaike information criterion.

iter

Number of iterations until convergence.

MI

Information matrix

Prev

Predicted values (if xpre and zpre is not NULL).

time

Processing time.

References

Vaida F, Liu L (2009). Fast implementation for normal mixed Effects models with censored response. Journal of Computational and Graphical Statistics; https://doi.org/10.1198/jcgs.2009.07130

Matos LA, Lachos V, Balakrishnan N, Labra F (2013). Influence diagnostics in linear and nonlinear mixed-effects models with censored data. Computational Statistics & Data Analysis; https://doi.org/10.1016/j.csda.2012.06.021

Schumacher FL, Lachos VH, Dey DK (2017). Censored regression models with autoregressive errors: A likelihood-based perspective. Canadian Journal of Statistics. https://doi.org/10.1002/cjs.11338

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
p.cens   = 0.1
m           = 10
D = matrix(c(0.049,0.001,0.001,0.002),2,2)
sigma2 = 0.30
phi    = c(0.48,-0.2)
beta   = c(1,2,1)
nj=c(6,5,6,8,5,7,8,6,5,4) 
x<-matrix(runif(sum(nj)*length(beta),-1,1),sum(nj),length(beta))
z<-matrix(runif(sum(nj)*dim(D)[1],-1,1),sum(nj),dim(D)[1])
data=ARpLMEC.sim(m,x,z,nj,beta,sigma2,D,phi,p.cens)
attach(data)
Arp    = 2
 ##Estimacao sem Previcao
teste1=ARpLMEC.est(y_cc,x,z,cc,nj,Arp,MaxIter = 10)

##Estimacao com Previcao
xx=matrix(runif(6*length(beta),-1,1),6,length(beta))
zz=matrix(runif(6*dim(D)[1],-1,1),6,dim(D)[1])
isubj=c(1,4,5)
teste2=ARpLMEC.est(y_cc,x,z,cc,nj,Arp,MaxIter=10,Prev=TRUE,step=2,isubj=isubj,xpre=xx,zpre=zz)
teste2$Prev
# }
# NOT RUN {

# }

Run the code above in your browser using DataCamp Workspace