did_longer: Convert a data.frame to long format

View source: R/did_utils.R

did_longerR Documentation

Convert a data.frame to long format

Description

Convert a data.frame to long format.

Usage

did_longer(
  data,
  outcomes = c("Y0", "Y1"),
  outcome = "Y",
  names_to = "var",
  timevar = "time"
)

Arguments

data

Dataframe of data to convert to long format.

outcomes

Character vector of base and final variables.

outcome

Name that will be used for the single outcome variable.

names_to

Name that will be used for the name variable.

timevar

Name that will be used for the time variable.

Details

Convert a data.frame to long format. A tie column will be added with 0 for baseline and 1 for final.

Value

Dataframe in long format.

See Also

did_linear did_loglinear did_logistic


FrankLef/fciR documentation built on Nov. 12, 2023, 6:09 a.m.