panel_to_ArCo_list: Transforms a balanced panel into a list of matrices...

Description Usage Arguments See Also Examples

View source: R/panel_to_ArCo_list.R

Description

Transforms a balanced panel into a list of matrices compatible with the fitArCo function. The user must identify the columns with the time, the unit identifier and the variables.

Usage

1
panel_to_ArCo_list(panel, time, unit, variables)

Arguments

panel

Balanced panel in a data.frame with columns for units and time.

time

Name or index of the time column.

unit

Name or index of the unit column.

variables

Names or indexes of the columns containing the variables.

See Also

fitArCo

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# = Generate a small panel as example = #
set.seed(123)
time=sort(rep(1:100,2))
unit=rep(c("u1","u2"),100)
v1=rnorm(200)
v2=rnorm(200)
panel=data.frame(time=time,unit=unit,v1=v1,v2=v2)
head(panel)

data=panel_to_ArCo_list(panel,time="time",unit="unit",variables = c("v1","v2"))
head(data$v1)

gabrielrvsc/ARCO documentation built on Nov. 8, 2017, 6:13 p.m.