chorussell: Conducts inference using the Cho-Russell procedure

View source: R/chorussell.R

chorussellR Documentation

Conducts inference using the Cho-Russell procedure

Description

This function conducts inference using the procedure proposed by Cho and Russell (2019).

Usage

chorussell(
  data = NULL,
  lpmodel,
  beta.tgt = NULL,
  n = NULL,
  R = 100,
  Rmulti = 1.25,
  kappa = 0,
  norm = 2,
  estimate = TRUE,
  solver = NULL,
  ci = NULL,
  alpha = 0.05,
  tol = 1e-04,
  progress = TRUE,
  remove.const = TRUE,
  previous.output = NA
)

Arguments

data

An data frame or a matrix.

lpmodel

The lpmodel object.

beta.tgt

The value to be tested.

n

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

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.

kappa

The tuning parameter used in the second step of the two-step procedure for obtaining the bounds subject to the shape constraints. It can be any nonnegative number or a vector of nonnegative numbers.

norm

The norm used in the optimization problem. It can be either a 1-norm or a 2-norm. See the details section of estbounds for a list of accepted strings.

estimate

A boolean variable to indicate whether the bounds should be estimated or not.

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.

ci

A boolean variable that indicates whether a p-value or a (1-α)-confidence interval is returned. If ci is TRUE, then a confidence interval is returned. Otherwise, a p-value is returned.

alpha

The significance level. This can be a vector.

tol

The tolerance level in the bisection procedure.

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.

remove.const

A boolean variable. This determine whether the constraints are to be removed.

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

  • See the details section of the estbounds function for a list of strings acceptable for the option norm.

  • The following components are required in the lpmodel for the Cho-Russell procedure:

    • A.tgt

    • A.obs

    • A.shp

    • beta.obs

    • beta.shp

    The input beta.tgt is not required when ci = TRUE.

Value

Returns the following list of output:

ub

The upper bound from original data.

lb

The lower bound from original data.

ub.bs

The list of upper bounds from bootstrap data.

lb.bs

The list of lower bounds from bootstrap data.

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 bound. If test.logical is 0, it refers to the case where beta.tgt is outside the logical bound.

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.

ci

A boolean variable that indicates whether a p-value or a (1-α)-confidence interval is returned.

pval

p-value (if ci is set as FALSE).

c.ub

The upper bound of the (1-α)-confidence interval.

c.lb

The lower bound of the (1-α)-confidence interval.

alpha

The significance level.

iter

The total number of iterations (if ci is FALSE.)

unique

A boolean variable showing whether the solution is unique.

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)
  chorussell(data = data,
             lpmodel = lpm,
             beta.tgt = .2,
             R = 100,
             norm = 2,
             ci = TRUE,
             solver = "gurobi")

More examples

More examples can be found in the chorussell_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.