longitudinal2array: Convert a longitudinal object into an array.

Description Usage Arguments Value Author(s) See Also Examples

View source: R/longitudinal2array.r

Description

Converts an object of the longitudinal-class into a 3-dim array (containing time-series data of multiple individuals).

Usage

1

Arguments

Y

Object of the longitudinal class. Essentially, this is a matrix with the timepoint slices of the array stacked on top of each other.

Value

A array-object containing time-series data.

Author(s)

Wessel N. van Wieringen <[email protected]>

See Also

array2longitudinal, dataVAR1, longitudinal, as.longitudinal.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# set dimensions (p=covariates, n=individuals, T=time points)
p <- 3; n <- 4; T <- 10

# set model parameters
SigmaE <- diag(p)/4
A      <- createA(p, "chain")

# generate data
Y <- dataVAR1(n, T, A, SigmaE)

# convert data to a longitudinal-object
Ylongitudinal <- array2longitudinal(Y)

# convert back to array-format
Yback <- longitudinal2array(Ylongitudinal)

ragt2ridges documentation built on Nov. 21, 2017, 5:06 p.m.