Learn R Programming

micsr: Microeconometrics with R

About

The micsr package is the companion package to the book "Microeconometrics with R" (Chapman and Hall/CRC The R Series). It includes function to estimate and to test models, miscellanous tools and data sets:

micsr provides methods described in the book that are not available in R. This includes:

  • testing functions:

    • scoretest for score (or Lagrange Multiplier) tests,
    • cmtest for conditional moment tests,
    • sargan for Sargan-Hansen's test of overidentified moment conditions,
    • hausman for Hausman's test,
    • ndvuong for non-degenerate Vuong test of Shi,
    • ftest for F test
  • function to estimate models:

    • binomreg binomal variable regression,
    • bivprobit bivariate probit model
    • clm constrained linear regression,
    • escount endogenous switching model for count data,
    • expreg exponentional mean regression model,
    • loglm log-linear models
    • tobit1 one-equation tobit model,
    • ordreg ordered variable regression,
    • poisreg poissong regression model,
    • pscore: matching models
  • miscellanous tools

    • gaze: print a short summary of an object,
    • dummy: generate a set of dummy variables from a factor,
    • newton: Newton-Raphson optimization method, using the analytical gradient and hessian,
    • mills: compute the inverse mills ratio and its first two derivatives,
    • stder: extract the standard errors of a fitted model,
    • npar: extract the number of parameters in a fitted model.
  • data sets:

    • apples: Apple production, Ivaldi and al. (1996), constrained

    linear model,

    • birthwt: Cigarette smoking and birth weigth, Mullahy

(1997), exponentional conditional mean regression model,

  • charitable: Intergenerational transmission of charitable

giving, Wilhem (2008), Tobit-1 model,

  • cigmales: Cigarettes consumption and smoking habits,

Mullahy (1997), exponentional conditional mean regression mdodel,

  • drinks: Physician advice on alcohol consumption, Kenkel and

Terza (2001), endogenous switching model for count data,

  • ferediv: Foreign exchange derivatives use by large US bank

holding companies, Adkins (2012), instrumental variable probit model,

  • fin_reform: Political economy of financial reforms, Abiad and

Mody (2005), ordered regression model,

  • housprod: Household production, Kerkhofs and Kooreman (2003),

bivariate probit model,

  • mode_choice: Choice between car and transit, Horowitz (1993),

probit model,

  • trade_protection: Lobying and trade protection, Atschke and

Sherlund (2006), instrumental variable Tobit-1 model,

  • trips: Determinants of household trip taking, Terza (1998),

endogenous switching model for count data,

  • turnout: Turnout in Texas liquor referenda, Coate and Conlin

(2004), non-degenerate Vuong test,

  • twa: Temporary help jobs and permanent employment, Ichino,

Mealli and Nannicini (2008), matching.

  • vignettes:
    • charitable: Estimating the Tobit-1 model with the charitable

data set

  • escount: Endogenous switching or sample selection models for

count data

  • expreg: Exponentional conditional mean models with endogeneity
  • ndvvuong: Implementation of Shi's non-degeranate Vuong test
  • lm_function: A extended description of the lm function
  • micsr_objects: A description of micsr

We tried to keep the sets of package on which micsr depends on as small as possible. micsr depends on Formula, generics, Rdpack and sandwich. We borrowed the gaussian quadrature function from the statmod package (Smyth and al., 2023), and the distribution function of quadratic forms in normal variables from the CompQuadForm package (Duchesne and Lafaye, 2010).

Installation

The micsr is on CRAN. To install it:

install.packages("micsr")

The development version is on github and can be installed using the pak package:

pak::pkg_install("ycroissant/micsr")

Copy Link

Version

Install

install.packages('micsr')

Monthly Downloads

305

Version

0.1-4

License

GPL (>= 2)

Maintainer

Yves Croissant

Last Published

October 27th, 2025

Functions in micsr (0.1-4)

ftest

F statistic
gauss_laguerre

Gauss-Laguerre quadrature
hausman

Hausman test
newton

Newton-Raphson method for numerical optimization
housprod

Household Production
federiv

Foreign exchange derivatives use by large US bank holding companies
maximize

Maximization of a function
ptnorm

Compute the probability for the trivariate normal function
punorm

Compute the probability for the univariate normal function
micsr-package

micsr : Microeconometrics with R
micsr

micsr class
mills

Compute the inverse Mills ratio and its first two derivatives
rsq

Coefficient of determination
quad_form

Compute quadratic form
poisreg

Poisson regression
pscore

Propensity scores
select_coef

select a subset of coefficients
mode_choice

Choice between car and transit
fin_reform

Political economy of financial reforms
random_group

Random control group
sargan

Sargan test for GMM models
scoretest

Score test
npar

Number of parameters of a fitted model
stder

Extract the standard errors of estimated coefficients
reexports

Objects exported from other packages
recall

recall
ndvuong

Non-degenerate Vuong test
vuong_sim

Simulated pdfs for the Vuong statistics using linear models
ivldv

Instrumental variable estimators for limited dependent variable
turnout

Turnout
unemp_duration

Unemployment Duration in Germany
twa

Temporary help jobs and permanent employment
loglm

Log-linear model
pbnorm

Compute the probability for the bivariate normal function
trade_protection

Lobying from Capitalists and Unions and Trade Protection
ordreg

Ordered regression
trips

Determinants of household trip taking
zellner_revankar

Generalized production function
weibreg

Weibull regression model for duration data
tobit1

Truncated response model
birthwt

Cigarette smoking and birth weight
bivprobit

Bivariate probit
cigmales

Cigarette smoking behaviour
charitable

Intergenerational transmission of charitable giving
escount

Endogenous switching and sample selection models for count data
dummy

Transform a factor in a set of dummy variables
drinks

Physician advice on alcohol consumption
expreg

Instrumental variable estimation for exponential conditional mean models
apples

Apple production
binomreg

Binomial regression
gaussian_quad

Gauss-Hermitte quadrature
gaze

Short print of the summary of an object
clm

Constrained least squares
cmtest

Conditional moments test