panel_to_ArCo_list {ArCo} | R Documentation |
Transforms a balanced panel into a list of matrices compatible with the fitArCo function
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
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
Examples
# = 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)
[Package ArCo version 0.3-1 Index]