Learn R Programming

ArfimaMLM (version 1.3)

extractVars: Extract and order variables from formula

Description

This is an internal function used within arfimaMLM and arfimaOLS. It is used to extract the variables marked with the suffixes .fd, .xdif, and .ydif from formula as well as .mean from ecmformula and create variable lists for the respective types of data manipulations.

Usage

extractVars(formula,ecmformula=NULL)

Arguments

formula
An object of the class "formula" that specifies a multilevel or a simple linear model. See lmer, lm, arfimaMLM, and arfimaOLS for details.
ecmformula
An object of the class "formula" that specifies a simple linear model. See lm, arfimaMLM, and arfimaOLS for details.

Value

The function returns a list of character vectors containing variable names selected for subsequent data manipulation:
mean
List of variables selected to calculate level means (i.e. variables originally augmented with suffixes .fd, .xdif, ydif, and .mean).
fd
List of variables selected for fractional differencing (i.e. variables originally augmented with suffixes .fd, and ydif).
xdif
List of variables originally augmented with the suffix .xdif.
xdif
List of variables originally augmented with the suffix .ydif.

See Also

arfimaMLM, arfimaOLS, ArfimaMLM.

Examples

Run this code

f1 <- y ~ x1.xdif + x2 + z1.fd + z2
f2 <- y.ydif ~ x1.xdif + x2 + z1.fd + z2.fd + (1+x1.xdif|time)
f3 <- y.mean ~ x1.mean

extractVars(formula = f1)
extractVars(formula = f2, ecmformula = f3)

Run the code above in your browser using DataLab