micsr: 'micsr' class

micsrR Documentation

micsr class

Description

The micsr class is intend to deal with a lot of different models that are estimated in the micsr package. More specifically, some models may be estimated using different estimation methods, like maximum likelihood, GMM or two-steps estimators. Objects of class micsr have an est_method item which is used by the different methods in order to have a relevent behaviour for the different methods.

Usage

llobs(x, ...)

## S3 method for class 'micsr'
coef(object, ..., subset = NA)

## S3 method for class 'micsr'
vcov(object, ..., vcov = c("info", "hessian", "opg"), subset = NA)

## S3 method for class 'micsr'
summary(object, ..., vcov = c("hessian", "info", "opg"), subset = NA)

## S3 method for class 'summary.micsr'
coef(object, ...)

## S3 method for class 'micsr'
print(x, digits = max(3L, getOption("digits") - 3L), ...)

## S3 method for class 'summary.micsr'
print(
  x,
  digits = max(3, getOption("digits") - 2),
  width = getOption("width"),
  ...
)

## S3 method for class 'micsr'
logLik(object, ..., type = c("model", "null", "saturated"))

## S3 method for class 'micsr'
BIC(object, ..., type = c("model", "null"))

## S3 method for class 'micsr'
AIC(object, ..., k = 2, type = c("model", "null"))

## S3 method for class 'micsr'
deviance(object, ..., type = c("model", "null"))

## S3 method for class 'micsr'
predict(object, ..., newdata = NULL)

## S3 method for class 'micsr'
model.part(object, ..., lhs = 1)

## S3 method for class 'micsr'
model.matrix(object, formula = NULL, ..., rhs = 1)

## S3 method for class 'micsr'
estfun(x, ...)

## S3 method for class 'micsr'
vcovHC(x, type, omega = NULL, sandwich = TRUE, ...)

## S3 method for class 'micsr'
bread(x, ...)

## S3 method for class 'micsr'
nobs(object, ...)

## S3 method for class 'micsr'
llobs(x, ...)

## S3 method for class 'mlogit'
llobs(x, ...)

## S3 method for class 'micsr'
tidy(x, conf.int = FALSE, conf.level = 0.95, ...)

## S3 method for class 'micsr'
glance(x, ...)

Arguments

x, object

an object which inherits the micsr class

...

further arguments

subset

a character which indicates which subset of coefficients should be extracted: one of noinst (all the coefficients except those corresponding to instrumental variables), all, covar (only the coefficients of the covariates), inst (only the coefficients of the instrumental variables) and misc (ony the "miscelanous" coefficients, typicaly a standard deviation or a coefficient of correlation)

vcov

the method used to compute the covariance matrix of the estimators (only for the ML estimator), one of hessian (the opposite of the inverse of the hessian), info (the inverse of the opposite of the expected value of the hessian), opg (the outer product of the gradient)

digits, width

see print

type, omega, sandwich

see sandwich::sandwich

k

see AIC

newdata

a new data frame to compute the predictions

lhs, rhs

see Formula::model.frame.Formula

formula

a formula

conf.int, conf.level

see broom:tidy.lm

Value

Objects of class micsr share a lot of common elements with lm: coefficients, residuals, fitted.values, model, terms, df.residual, xlevels, na.action, and call. npar is a named vector containing the index of subset of coefficients, it is used to print a subset of the results. It also has a est_method element and, depending of its value, contains further elements. In particular, for model fitted by maximum likelihood, value contains the individual contribution to the log-likelihood function, gradient the individual contribution to the gradient, hessian the hessian and information the information matrix. logLik contains the log-likelihood values of the proposed, null and saturated models. tests contains the values of the test that all the coefficients of the covariates are 0, using the three classical tests.

The llobs function is provided as a generic to extract the individual contributions to the log-likelihood

Specific methods have been writen for micsr objects: nobs, generics::tidy, generics::glance, sandwich::meat, sandwich::estfun, predict, model.matrix, Formula::model.part.

logLik, BIC, AIC and deviance methods have a type argument to select theproposed, null or saturated model.

vcov and summary methods have a vcov argument to select the estimator of the covariance matrix, which can be either based on the hessian, the gradient or the information.

vcov, summary and coef have a subset argument to select only a subset of the coefficients


micsr documentation built on May 29, 2024, 7:32 a.m.