Description Usage Arguments Value Author(s) References Examples
View source: R/bndovbme_tuning.R
This function computes an optimal tuning parameter to compute the confidence interval for bndovbme function The function returns an optimal tuning parameter using double bootstrap procedure
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
maindat |
Main data set. It must be a data frame. |
auxdat |
Auxiliary data set. It must be a data frame. |
depvar |
A name of a dependent variable in main dataset |
pvar |
A vector of the names of the proxy variables for the omitted variable. When proxy variables are continuous, the first proxy variable is used as an anchoring variable. When proxy variables are discrete, the first proxy variable is used for initialization (For details, see a documentation for "dproxyme" function). |
ptype |
Either 1 (continuous) or 2 (discrete). Whether proxy variables are continuous or discrete. Default is 1 (continuous). |
comvar |
A vector of the names of the common regressors existing in both main data and auxiliary data |
sbar |
A cardinality of the support of the discrete proxy variables. Default is 2. If proxy variables are continuous, this variable is irrelevant. |
mainweights |
An optional weight vector for the main dataset. The length must be equal to the number of rows of 'maindat'. |
auxweights |
An optional weight vector for the auxiliary dataset. The length must be equal to the number of rows of 'auxdat'. |
normalize |
Whether to normalize the omitted variable to have mean 0 and standard deviation 1. Set TRUE or FALSE. Default is TRUE. If FALSE, then the scale of the omitted variable is anchored with the first proxy variable in pvar list. |
signres |
An option to impose a sign restriction on a coefficient of an omitted variable. Set either NULL or pos or neg. Default is NULL. If NULL, there is no sign restriction. If 'pos', the estimator imposes an extra restriction that the coefficient of an omitted variable must be positive. If 'neg', the estimator imposes an extra restriction that the coefficient of an omitted variable must be negative. |
nboot |
Number of bootstraps to compute the confidence interval. Default is 100. |
scalegrid |
Tuning parameter grid to search. It must be a vector of numbers between -1/2 and 0. Default is c(-1/2,-1/3,-1/4,-1/5,-1/6). |
tau |
Significance level. (1-tau)% confidence interval is computed. Default is 0.05. |
seed |
Seed for random number generation. Default is 210823. |
parallel |
Either TRUE or FALSE. Whether to compute in parallel. Default is TRUE. |
Returns a list of 3 components :
An optimal scale parameter which gives coverage rates closest to (1-tau)
A matrix of coverage rates of the lower bound parameters under different scale parameters
A matrix of coverage rates of the lower bound parameters under different scale parameters
Yujung Hwang, yujungghwang@gmail.com
Bounding Omitted Variable Bias Using Auxiliary Data. Available at SSRN.doi: 10.2139/ssrn.3866876
1 2 3 4 5 6 7 8 9 10 11 | ## load example data
data(maindat_mecont)
data(auxdat_mecont)
## set ptype=1 for continuous proxy variables
pvar<-c("z1","z2","z3")
cvar<-c("x","w1")
# To shorten computation time, I set the number of bootstrap small in an example below.
# In practice, please set it a large number
bndovbme_tuning(maindat_mecont,auxdat_mecont,depvar="y",pvar=pvar,ptype=1,comvar=cvar,nboot=2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.