AutoCorrelationLRtest {REEMtree} | R Documentation |
This function tests for autocorrelation in the residuals of a RE-EM tree using a likelihood ratio test. The test keeps the tree structure of the RE-EM tree object fixed and uses a standard likelihood ratio test on the linear random effects model.
AutoCorrelationLRtest(object, newdata)
object |
A RE-EM tree |
newdata |
Dataset on which the test is to be performed |
In general, newdata
is likely to be the data used to estimate object
. The RE-EM tree can be estimated with or without allowing for autocorrelation. Because the estimated tree may differ depending on whether autocorrelation is allowed in the RE-EM tree estimation process, but we recommend testing based on the tree estimated with autocorrelation allowed and the tree estimated without autocorrelation allowed.
loglik0 |
Likelihood of the random effects model if there is no autocorrelation |
loglikAR |
Likelihood of the random effects model if autocorrelation (of type AR(1)) is estimated |
pvalue |
P-value of the likelihood ratio test |
Rebecca Sela rsela@stern.nyu.edu
Sela, Rebecca J., and Simonoff, Jeffrey S., “RE-EM Trees: A New Data Mining Approach for Longitudinal Data”.
data(simpleREEMdata) # Estimation without autocorrelation simpleEMresult<-REEMtree(Y~D+t+X, data=simpleREEMdata, random=~1|ID, simpleREEMdata$ID) # Estimation with autocorrelation simpleEMresult2<-REEMtree(Y~D+t+X, data=simpleREEMdata, random=~1|ID, simpleREEMdata$ID, correlation=corAR1()) # Autocorrelation test based on the first tree AutoCorrelationLRtest(simpleEMresult, simpleREEMdata) # Autocorrelation test based on the second tree AutoCorrelationLRtest(simpleEMresult2, simpleREEMdata)