mc_ma | R Documentation |
The function mc_ma
helps to build the components
of the matrix linear predictor associated with moving average models.
This function is generaly used for the analysis of longitudinal and
times series data. The user can specify the order of the moving
average process.
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 |
order of the moving average process. |
This function was designed mainly to deal with longitudinal
data, but can also be used for times series analysis. In that case,
the id
argument should contain only one index. It pretends a
longitudinal data taken just for one individual or unit sample. This
function is a simple call of the bandSparse
function from the Matrix
package.
A matrix of dgCMatrix
class.
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.