| mc_ma | R Documentation |
Builds components of the matrix linear predictor associated with moving average (MA) covariance structures. This function is mainly intended for longitudinal data analysis, but can also be used for time series data
mc_ma(id, time, data, order = 1)
id |
name of the column (string) containing the subject index.
Note that this structure was designed to deal with longitudinal data.
For times series data use the same |
time |
name of the column (string) containing the index indicating the time. |
data |
data set. |
order |
An integer specifying the order of the moving average process. |
This function was primarily designed for longitudinal data,
but it can also be used for time series analysis. In this case, the
id argument should contain a single identifier, representing
one observational unit. Internally, the function constructs block-diagonal
band matrices using bandSparse.
A list with the following component:
A sparse matrix of class nsCMatrix representing the
moving average component of the matrix linear predictor. The matrix
has dimension equal to the total number of observations and is
constructed as a block-diagonal matrix, with one block per subject
(or time series), each block encoding a moving average structure of
the specified order.
Wagner Hugo Bonat, wbonat@ufpr.br
Bonat, W. H. (2018). Multiple Response Variables Regression Models in R: The mcglm Package. Journal of Statistical Software, 84(4):1–30.
mc_id, mc_dist, mc_car,
mc_rw and mc_mixed.
id <- rep(1:2, each = 4)
time <- rep(1:4, 2)
data <- data.frame("id" = id, "time" = time)
mc_ma(id = "id", time = "time", data = data, order = 1)
mc_ma(id = "id", time = "time", data = data, order = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.