Skip to contents

Panel isat function

Usage

isatpanel(
  data = NULL,
  formula = NULL,
  index = NULL,
  effect = c("individual"),
  na.remove = TRUE,
  engine = NULL,
  user.estimator = NULL,
  cluster = "none",
  ar = 0,
  iis = FALSE,
  sis = FALSE,
  jiis = FALSE,
  jsis = FALSE,
  fesis = FALSE,
  csis = FALSE,
  cfesis = FALSE,
  csis_var = colnames(mxreg),
  fesis_id = NULL,
  cfesis_var = colnames(mxreg),
  cfesis_id = NULL,
  plot = FALSE,
  plm_model = "within",
  y = NULL,
  id = NULL,
  time = NULL,
  mxreg = NULL,
  ...
)

Arguments

data

The input data.frame object.

formula

Please specify a formula argument. The dependent variable will be the left-most element, separated by a ~ symbol from the remaining regressors. Note the intercept will always be removed, if effect is not "none" - this means that if any fixed effects are specified, the intercept will always be removed.

index

Specify the name of the group and time column in the format c("id", "time").

effect

Fixed Effect specification. Possible arguments: "twoways", "individual", "time", or "none".

na.remove

remove NAs

engine

Estimation function to use. Default is NULL, which uses the default estimation procedure of the gets package. Alternatives are "fixest", "plm", or "felm".

user.estimator

Use a user.estimator

cluster

cluster Standard Errors at this level. Default is "none". Possible values are: "indvidiual", "time", or "twoways".

ar

Autoregressive Term to be included. default is 0.

iis

use Impulse Indicator Saturation

sis

use Step Indicator Saturation. This is only possible if time fixed effects are not used, as they are collinear otherwise.

jiis

use Joint Impulse Indicator Saturation (Outliers are common across all units). This is essentially just a time fixed effect, but this allows selection of FE.

jsis

use Join Step Indicator Saturation (steps are common across all units)

fesis

Fixed Effect Step Indicator Saturation. Constructed by multiplying a constant (1) with group Fixed Effects. Default is FALSE.

csis

Coefficient Step Indicator Saturation. Constructed by Default is FALSE.

cfesis

Coefficient-Fixed Effect Indicator Saturation. Default is FALSE.

csis_var

The csis method can be conducted for all (default) variables or just a subset of them. If you want to use a subset, please specify the column names of the variable in a character vector.

fesis_id

The fesis method can be conducted for all (default) individuals/units (i.e. looking for breaks in individual countries) or just a subset of them (joint breaks in the coefficients for a few individuals). If you want to use a subset, please specify the individuals/units for which you want to test the stability in a character vector.

cfesis_var

The cfesis method can be conducted for all variables (default) or just a subset of them. If you want to use a subset, please specify the column names of the variable in a character vector.

cfesis_id

The cfesis method can be conducted for all individuals/units (default) or just a subset of them. If you want to use a subset, please specify the individuals/units to be tested in a character vector.

plot

Logical. Should the final object be plotted? Default is FALSE.

plm_model

Type of PLM model (only if engine = "PLM")

y

Deprecated. The dependent variable. Can be used when data, index, and formula are not specified.

id

Deprecated. Can be used when data, index, and formula are not specified. Must be a vector of the grouping variable as a character or factor

time

Deprecated. Can be used when data, index, and formula are not specified. Must be a vector of the time variable as an integer or numeric.

mxreg

The co-variates matrix

...

Further arguments to gets::isat()

Value

an isatpanel object

References

Felix Pretis and Moritz Schwarz (2022). Discovering What Mattered: Answering Reverse Causal Questions by Detecting Unknown Treatment Assignment and Timing as Breaks in Panel Models. January 31, 2022. Available at SSRN: https://ssrn.com/abstract=4022745 or http://dx.doi.org/10.2139/ssrn.4022745

Examples

if (FALSE) {
data <- pandata_simulated

is1 <- isatpanel(data = data, gdp ~ temp, index = c("country","year"),
effect="twoways",iis=FALSE,fesis=TRUE,t.pval=0.01)
plot(is1)
plot_grid(is1)

is2 <- isatpanel(data = data, gdp ~ temp + I(temp^2), index = c("country","year"),
effect="twoways",iis=TRUE,fesis=TRUE, csis = TRUE,t.pval=0.01,engine = "fixest")
plot(is2)
plot_grid(is2)}