Learn R Programming

BMisc (version 1.4.2)

panel2cs2: Panel Data to Repeated Cross Sections

Description

panel2cs2 takes a 2 period dataset and turns it into a cross sectional dataset; i.e., long to wide. This function considers a particular case where there is some outcome whose value can change over time. It returns the dataset from the first period with the outcome in the second period and the change in outcomes over time appended to it

Usage

panel2cs2(data, yname, idname, tname)

Arguments

data

data.frame used in function

yname

name of outcome variable that can change over time

idname

unique id

tname

time period name

Value

data from first period with y0 (outcome in first period), y1 (outcome in second period), and dy (change in outcomes over time) appended to it