Introduction to snreg

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.width = 7,
  fig.height = 5
)
library(snreg)

Overview

The snreg package offers a set of methods for conducting regression analysis when the model errors follow a skew-normal distribution.

Framework

The snreg package implements the framework developed in:

Oleg Badunenko and Daniel J. Henderson (2023). "Production analysis with asymmetric noise". Journal of Productivity Analysis, 61(1), 1–18. DOI

Data

We illustrate the functionality using the banks07 dataset, which contains selected variables for 500 U.S. commercial banks randomly sampled for the year 2007.

Note: The dataset is provided solely for illustration and pedagogical purposes and is not suitable for empirical research.

data(banks07, package = "snreg")
head(banks07)

Model Specification

Define the translog cost function specification:

spe.tl <- log(TC) ~ (log(Y1) + log(Y2) + log(W1) + log(W2))^2 +
  I(0.5 * log(Y1)^2) + I(0.5 * log(Y2)^2) +
  I(0.5 * log(W1)^2) + I(0.5 * log(W2)^2)

Linear Regression via MLE

Homoskedastic Model

formSV <- NULL

m1 <- lm.mle(
  formula   = spe.tl,
  data      = banks07,
  ln.var.v  = formSV
)

coef(m1)

Heteroskedastic Model

Variance depends on total assets (TA):

formSV <- ~ log(TA)

m2 <- lm.mle(
  formula   = spe.tl,
  data      = banks07,
  ln.var.v  = formSV
)

coef(m2)

Linear Regression with Skew-Normal Errors

The snreg() function fits a linear regression model where the disturbance term follows a skew-normal distribution.

Homoskedastic and Symmetric Model

formSV <- NULL     # variance equation
formSK <- NULL     # skewness equation

m1 <- snreg(
  formula  = spe.tl,
  data     = banks07,
  ln.var.v = formSV,
  skew.v   = formSK
)

coef(m1)

Heteroskedastic with Skewed Noise

formSV <- ~ log(TA)   # heteroskedasticity in v
formSK <- ~ ER        # skewness driven by equity ratio

m2 <- snreg(
  formula  = spe.tl,
  data     = banks07,
  ln.var.v = formSV,
  skew.v   = formSK
)

coef(m2)

Stochastic Frontier Model with Skew-Normal Errors

The snsf() function performs maximum likelihood estimation of parameters and technical or cost efficiencies in a Stochastic Frontier Model with a skew-normally distributed error term.

Homoskedastic and Symmetric Model

myprod <- FALSE

formSV <- NULL   # variance equation
formSK <- NULL   # skewness equation

m1 <- snsf(
  formula  = spe.tl,
  data     = banks07,
  prod     = myprod,
  ln.var.v = formSV,
  skew.v   = formSK
)

coef(m1)

Heteroskedastic with Skewed Noise

formSV <- ~ log(TA)      # heteroskedastic variance
formSK <- ~ ER           # skewness driver

m2 <- snsf(
  formula  = spe.tl,
  data     = banks07,
  prod     = myprod,
  ln.var.v = formSV,
  skew.v   = formSK
)

coef(m2)

Acknowledgments

The R package snreg computes Owen's T function using C code written by John Burkardt. This implementation, distributed under the MIT license, is publicly accessible at https://people.sc.fsu.edu/~jburkardt/c_src/owen/owen.html.

References

Badunenko, O. and Henderson, D.J. (2023). Production analysis with asymmetric noise. Journal of Productivity Analysis, 61(1), 1–18. https://doi.org/10.1007/s11123-023-00680-5



Try the snreg package in your browser

Any scripts or data that you put into this service are public.

snreg documentation built on Feb. 6, 2026, 5:08 p.m.