Usage
dfldens(y,lgtform,window=0,bandwidth=0,kern="tcub",probit=FALSE,
graph=TRUE,yname="y",alldata=FALSE,data=NULL)
Arguments
y
The dependent variable for which the counterfactual density is estimated. The data frame must be specified if it has not been attached, e.g.,
y=mydata$depvar.
lgtform
The formula for the logit or probit model for the time variable. The dependent variable should be a 0-1 variable with 1's representing
the later time period. Example: lgtform=timevar~x1+x2.
window
The window size for the kernel density function. Default: not used.
bandwidth
The bandwidth. Default: bandwidth = (.9*(quantile(y1,.75)-quantile(y1,.25))/1.34)*(n1^(-.20)),
specified by setting bandwidth = 0 and window = 0.
kern
Kernel weighting function. Default is the tri-cube. Options include "rect", "tria", "epan", "bisq", "tcub", "trwt", and "gauss".
probit
If TRUE, a probit model is used for the time variable rather than logit. Default: probit = FALSE.
graph
If TRUE, produces a graph showing the density function for time 1 and the counterfactual density. Default: graph=TRUE.
yname
The name to be used for the variable whose density functions are drawn when graph=T. Default: yname = "y".
alldata
If TRUE, the density functions are calculated using each observation in turn as a target value.
When alldata=F, densities are calculated at a set of points chosen by the locfit program using an adaptive decision tree approach
data
A data frame with the variables for the logit or probit model specified by lgtform. Note: the data frame for y must be
specified even if it is part of data.