its_llm_placebo: Placebo Estimates via Local Linear Regression with...

Description Usage Arguments Details Value See Also Examples

Description

its_llm estimates placebo intercept shift of a time series permuting the cut-point.

Usage

1
2
its_llm_placebo(df, rvar, outcome, trend = "none", bw, donut = 0,
  nsim = 200)

Arguments

df

(required) data.frame containing all variables

rvar

(required) the name of the running variable in df

outcome

(required) the name of the outcome variable in df

trend

include a linear term ('lin'), a quadratic term ('quad') or no trend at all ('none')?

bw

either a scalar or a vector of length 2 defining the bandwidth to the left (right) of the cut-point on the scale of rvar

donut

either a scalar or a vector of length 2 defining the length of the period to the left (right) of the cut-point for which the data are dropped (on the scale of rvar).

nsim

if the number of potential placebo estimates is larger than nsim, only a random sample of nsim estimates is formed.

Details

Permutes the cut-point of a time series within the data points that are observed before the cut-point. The resulting distribution can be thought of as a distribution of typical shifts in the time series conditional on a selected local linear regression specification and might used as a reference distribution to make inferences about the actual estimate at the cut-point.

The function only forms placebo estimates for values of the running variable that are sufficiently enough away from the left boundary of the time series (min(rvar)+bwL) and the cut-point (0-bwR-donut) such that a local linear regression with the specified bandwidth can be estimated. Use its_plot_samples to visualize the implied interval from which placebo estimates are formed.

Value

numeric vector of placebo estimates.

See Also

its_plot_samples, its_llm.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 

  N <- 21
  time <- seq(-1,1,length.out=N)
  treat <- as.numeric(time >= 0)
  y <- 1 + time + treat*1 + rnorm(N,0,0.25)
  df <- data.frame(y=y, time=time)
  its_llm_placebo(df, rvar="time", outcome="y", bw=0.25)


## End(Not run)

sumtxt/itstools documentation built on May 30, 2019, 8:38 p.m.