check.lpmodel: Check function: 'lpmodel'

View source: R/checks.R

check.lpmodelR Documentation

Check function: lpmodel

Description

This function checks if the object lpmodel is in the correct format.

Usage

check.lpmodel(
  data,
  lpmodel,
  name.var,
  A.tgt.cat,
  A.obs.cat,
  A.shp.cat,
  beta.obs.cat,
  beta.shp.cat,
  R,
  is.estbounds = FALSE
)

Arguments

data

An data frame or a matrix.

lpmodel

An lpmodel object.

name.var

The name of the lpmodel object.

A.tgt.cat

The category of the A.tgt object.

A.obs.cat

The category of the A.obs object.

A.shp.cat

The category of the A.shp object.

beta.obs.cat

The category of the beta.obs object.

beta.shp.cat

The category of the beta.shp object.

R

The number of bootstrap replications.

is.estbounds

A boolean variable that indicates whether the test function being called is estbounds. If this function is being called, then it means that when data is NULL, then each component of the lpmodel object is not required to be a list. Otherwise, the lpmodel object needs to contain the bootstrap estimates if data is NULL.

Details

In each of the testing procedures, there are six possible categories for the each of the objects:

  • not_used: This refers to the case where the object is not used in the function.

  • matrix: This refers to the case where the object has to be a matrix.

  • function_mat: This refers to the case where the object has to be a function that produces a matrix.

  • list: This refers to the case where the object is a list.

  • function_obs_var: This refers to the case where the object is a function that produces a list that contains a matrix and a vector. This is typically the case for beta.obs when the testing procedure requires both the observed value of beta.obs and the estimator of the asymptotic variance.

  • function_obs_var_bs: This is essentially the same as the function_obs_var category. However, when the variance matrix is not provided, it will be estimated by standard nonparametric bootstrap so there is no problem in case the variance matrix is not provided.

Each object can belong to one of more categories.

Value

Returns the updated lpmodel object.

lpmodel

An updated lpmodel object.


conroylau/lpinfer documentation built on Sept. 5, 2024, 9 p.m.