make_diff_data: Generate differenced and asymmetric effects data

View source: R/diffs.R

make_diff_dataR Documentation

Generate differenced and asymmetric effects data

Description

This is an interface to the internal functions that process data for fdm(), asym(), and asym_gee().

Usage

make_diff_data(
  formula,
  data,
  id = NULL,
  wave = NULL,
  use.wave = FALSE,
  min.waves = 1,
  weights = NULL,
  offset = NULL,
  asym = FALSE,
  cumulative = FALSE,
  escape.names = FALSE,
  ...
)

Arguments

formula

Model formula. See details for crucial info on panelr's formula syntax.

data

The data, either a panel_data object or data.frame.

id

If data is not a panel_data object, then the name of the individual id column as a string. Otherwise, leave as NULL, the default.

wave

If data is not a panel_data object, then the name of the panel wave column as a string. Otherwise, leave as NULL, the default.

use.wave

Should the wave be included as a predictor? Default is FALSE.

min.waves

What is the minimum number of waves an individual must have participated in to be included in the analysis? Default is 2 and any valid number is accepted. "all" is also acceptable if you want to include only complete panelists.

weights

If using weights, either the name of the column in the data that contains the weights or a vector of the weights.

offset

this can be used to specify an a priori known component to be included in the linear predictor during fitting. This should be NULL or a numeric vector of length equal to the number of cases. One or more offset terms can be included in the formula instead or as well, and if more than one is specified their sum is used. See model.offset.

asym

Return asymmetric effects transformed data? Default is FALSE.

cumulative

Return cumulative positive/negative differences, most useful for fixed effects estimation and/or generalized linear models? Default is FALSE.

escape.names

Return only syntactically valid variable names? Default is FALSE.

...

Ignored.

Examples


data("WageData")
wages <- panel_data(WageData, id = id, wave = t)
make_diff_data(wks ~ lwage + union, data = wages)
 

panelr documentation built on Aug. 22, 2023, 5:08 p.m.