Learn R Programming

sfaR (version 1.0.0)

nobs: Extract total number of observations used in frontier models

Description

This function extracts the total number of 'observations' from a fitted frontier model.

Usage

# S3 method for sfacross
nobs(object, ...)

# S3 method for sfalcmcross nobs(object, ...)

# S3 method for sfaselectioncross nobs(object, ...)

Value

A single number, normally an integer.

Arguments

object

a sfacross, sfalcmcross, or sfaselectioncross object for which the number of total observations is to be extracted.

...

Currently ignored.

Details

nobs gives the number of observations actually used by the estimation procedure. It is not necessarily the number of observations of the model frame (number of rows in the model frame), because sometimes the model frame is further reduced by the estimation procedure especially in the presence of NA. In the case of sfaselectioncross, nobs returns the number of observations used in the frontier equation.

See Also

sfacross, for the stochastic frontier analysis model fitting function using cross-sectional or pooled data.

sfalcmcross, for the latent class stochastic frontier analysis model fitting function using cross-sectional or pooled data.

sfaselectioncross for sample selection in stochastic frontier model fitting function using cross-sectional or pooled data.

Examples

Run this code

if (FALSE) {
## Using data on fossil fuel fired steam electric power generation plants in the U.S.
# Translog (cost function) half normal with heteroscedasticity
tl_u_h <- sfacross(formula = log(tc/wf) ~ log(y) + I(1/2 * (log(y))^2) +
log(wl/wf) + log(wk/wf) + I(1/2 * (log(wl/wf))^2) + I(1/2 * (log(wk/wf))^2) +
I(log(wl/wf) * log(wk/wf)) + I(log(y) * log(wl/wf)) + I(log(y) * log(wk/wf)),
udist = 'hnormal', uhet = ~ regu, data = utility, S = -1, method = 'bfgs')
nobs(tl_u_h)
}

Run the code above in your browser using DataLab