*! version 2.0.0 July 2019 Fernando Rios Avila

Title

vc_graph -- Command for plotting coefficients obtained with vc_reg or vc_bsreg

Syntax

Smooth Varying Coefficient model: Coefficient Plots

vc_graph
[varlist]
[, options]

NOTE: Varlist may contain any or all of the variables used for the estimation of the Varying coefficient model in vc_reg or vc_bsreg.

Main options
ci(#) Indicates the level of the confidence interval in percentage. The default is 95% normal based confidence interval

constant Use this option when the interest its on plotting the constant.

delta Use this option when the interest is on plotting rate of change of the coefficients, respect to the smoothing variable. Can be used in combination with constant.
Use this option when the interest its on plotting rate of change of the coefficients with respect to the smoothing variable. For any given model with the form
y=a0(z)+b0(z)*X+a1(z)*delta+b1(z)*X*delta, where delta=(z-z0), this option will plot the coefficients b1. The default is to plot the coefficients b0. If used in combination with
constant, it will plot the coefficient a1(z) as well.

xvar(varname) Request to use an alternative variable to create the coefficient plots. This new variable should be a monotonic transformation of the original smoothing variable h=h(z).
For example, one can use lz=log(z) to estimate the SVCM, but decide to use Z to plot the coefficients. In this case one would use xvar(z)

graph(str) Provides a stub to be used as prefix for the created plots, which are saved in memory. Default its "grph". Graphs are named consecutively

rarea Request using "area" graph for the estimation of the confidence intervals. Default its to use rcap.

ci_off Request to plot only the point estimates but not the confidence intervals.

pci When using vc_bsreg, it is possible to request to plot the percentile based confidence intervals rather than normal based. Cannot be used incombination with ci(#)

addgraph(str) It requests to add a plot to the generated graph. For example, vc_graph x1, addplot(scatter g x1) will create a twoway graph that includes the "scatter g x1"

Description

vc_graph is a command used to plot the coefficients of the SVCM, using all the points of reference used in vc_reg, vc_preg or vc_bsreg. You can select to
plot all the coefficients estimated of the model (i.e b(z)), or the rate of change of those coefficients respect to z (ie db(z)/dz).

The module also allows you to plot the figures using a variable different from the original vcoeff variable. The alternative variable should be a monotonic transformation from the original variable.
For example, one may want to estimate the varying coefficients with respect to log(z), but plot the figures with respect to z.

If B(z0) its the smooth coefficient around the point z0, and h=h(z) is a monotonic transformation of z, then B(h0) is also the smooth coefficient around the point h0. This can
be used to implement an strategy alternative to the use of adaptive bandwidth, for segments where the distribution of Z is sparse.

2 or more points of references needed to be estimated to use vc_graph.

Details on the command can be found at Rios-Avila (2019)

Examples

* Estimating the SVCM for acceleration as a function of time
* Defining BW
webuse motorcycle, clear
vc_bw accel, vcoeff(time)
* Estimating the SVCoefficients
vc_reg accel, vcoeff(time) klist( 2.4/57.6) robust
vc_graph , constant
vc_graph , delta constant
gen lntime=ln(time)
gen sqtime=time^2
vc_graph , delta constant xvar(sqtime)
vc_graph , delta constant xvar(lntime)
* Estimating SVCM model for DUI
webuse dui, clear
vc_bw citations i.csize college taxes, vcoeff( fines )
vc_reg citations i.csize college taxes, vcoeff( fines ) bw(.7398) klist(7.4(.2)12) robust
vc_graph i.csize college taxes, constant
vc_graph i.csize college taxes, delta

*Normal transformation for Fines.
sum fines
gen Fn=normal((fines-r(mean))/r(sd))
* Graph agains the normal percentile
vc_graph i.csize college taxes, constant xvar(Fn)
vc_graph i.csize college taxes, delta xvar(Fn)

Author

Fernando Rios-Avila

Levy Economics Institute of Bard College

Blithewood-Bard College

Annandale-on-Hudson, NY

friosavi@levy.org

References

Hastie, Trevor, and Robert Tibshirani. 1990. Generalized Additive Models. New York: Chapman and Hall.
Hastie, Trevor, and Robert Tibshirani. 1993. "Varying-Coefficient Models." Journal of the Royal Statistical Society. Series B (Methodological) 55 (4):757-796.
Henderson, Daniel J., and Christopher F. Parmeter. 2015. Applied Nonparametric Econometrics. Cambridge, United Kingdom: Cambridge University Press.
Li, Qi, and Jeffrey Scott Racine. 2007. Nonparametric Eonometrics: Theory and Practice. New Jersey: Princeton University Press.
Li, Qi, and Jeffrey Scott Racine. 2010. "Smooth Varying-Coefficient Estimation and Inference for Qualitative and Quantitative Data." Econometric Theory 26 (6):1607-1637.
Rios-Avila, Fernando (2019) Smooth varying coefficient models in Stata. Working paper.