Learn R Programming

pmpp (version 0.1.1)

create_fframe: Add empty rows with time stamps to each cress-sectional unit in the panel

Description

Creates a forecast frame as required by the predict.pmpp() method. To each cross-sectional unit in the data, a specified number of rows are added that contain only this unit's ID and the selected time ID.

Usage

create_fframe(indata, timestamps, panel_ind = colnames(indata[, 1:2]),
  overwrite = FALSE)

Arguments

indata

data.frame with a panel structure

timestamps

vector of time IDs for the added time periods

panel_ind

vector of length 2 indicating names of variables indexing units and time periods respectively

overwrite

logical; if TRUE, existing rows in the data are overwritten with empty rows if their time ID is in timestamps

Value

A data.frame with empty rows added.

Examples

Run this code
# NOT RUN {
data(EmplUK, package = "plm")
EmplUK <- dplyr::filter(EmplUK, year %in% c(1978, 1979, 1980, 1981, 1982))
my_fframe <- create_fframe(EmplUK, 1983)
# }

Run the code above in your browser using DataLab