dkqs: Conducts inference using the DKQS procedure

View source: R/dkqs.R

dkqsR Documentation

Conducts inference using the DKQS procedure

Description

This module conducts inference using the cone-tightening procedure proposed by Deb, Kitamura, Quah and Stoye (2018).

Usage

dkqs(
  data = NULL,
  lpmodel,
  beta.tgt,
  R = 100,
  Rmulti = 1.25,
  tau = NULL,
  n = NULL,
  solver = NULL,
  progress = TRUE,
  previous.output = NA
)

Arguments

data

An data frame or a matrix.

lpmodel

An lpmodel object.

beta.tgt

The value to be tested.

R

The number of bootstrap replications.

Rmulti

The multiplier for the number of bootstrap replications. The product of Rmulti and R refers to the maximum number of bootstrap replications to be conducted if there are errors.

tau

The value of the tuning parameter τ in the DKQS procedure. This can be a vector.

n

The sample size. This is only required if data is omitted in the input.

solver

The name of the linear and quadratic programming solver that is used to obtain the solution to linear and quadratic programs. The solvers supported by this package are cplexAPI, gurobi, limSolve and Rcplex.

progress

The boolean variable for whether the progress bars should be displayed. If it is set as TRUE, the progress bars will be displayed while the code is running.

previous.output

The list of outputs obtained from the previous evaluation of the procedure. This is only used in the fsst test and when previous.out contains the studentized matrix omega.i. The rest of the arguments are ignored.

Details

  • If the value of the test statistic T_n is zero, the bootstrap procedure will be skipped and the p-value is zero.

  • The following components are required in the lpmodel for the DKQS procedure:

    • A.tgt

    • A.obs

    • beta.obs

Value

Returns the following list of outputs:

pval

A table of p-values for each τ.

tau.feasible

The list of τ that are feasible.

tau.infeasible

The list of τ that are infeasible.

tau.max

The maximum value of the feasible τ for the problem.

T.n

The test statistic T_n.

T.bs

The list of bootstrap test statistics \{\overline{T}_{n,b}(τ_n)\}^B_{b=1} for each τ.

solver

The solver used.

cv.table

A table of critical values.

call

The function that has been called.

test.logical

An indicator variable for whether the computation has been conducted. If test.logical is 1, it refers to the case where beta.tgt is inside the logical bounds. If test.logical is 0, it refers to the case where beta.tgt is outside the logical bounds.

logical.lb

The logical lower bound.

logical.ub

The logical upper bound.

df.error

A table showing the id of the bootstrap replication(s) with error(s) and the corresponding error message(s).

R.succ

The number of successful bootstrap replications.

Example

  source("./example/dgp_missingdata.R") # Change directory if necessary
  J <- 5
  N <- 1000
  data <- missingdata_draw(J = J, n = N, seed = 1, prob.obs = .5)
  lpm <- missingdata_lpm(J = J, info = "full", data = data)
  dkqs(data = data,
       lpmodel = lpm,
       beta.tgt = .2,
       R = 100,
       tau = sqrt(log(N)/N),
       solver = "gurobi")

More examples

More examples can be found in the dkqs_example.R file under the example subdirectory of the installation directory for the lpinfer package.


conroylau/lpinfer documentation built on Oct. 23, 2022, 9:21 a.m.