Econometrics.DATAPATHConstant
const DATAPATH::String = realpath(joinpath(dirname(pathof(Econometrics)), "..", "data"))

Return the path to the data directory for the Econometrics.jl module.

Econometrics.BetweenEstimatorType
BetweenEstimator(effect::Symbol,
                 groups::Vector{Vector{Int}}) <: LinearModelEstimators

Continuous response estimator collapsing a dimension in a longitudinal setting.

Econometrics.ContinuousResponseType
ContinuousResponse(groups::Vector{Vector{Vector{Int}}}) <: LinearModelEstimators

Continuous response estimator with potential features absorption.

Econometrics.EconometricModelType
EconometricModel(estimator::Type{<:Union{EconometricModel,ModelEstimator}},
                 f::FormulaTerm,
                 data;
                 contrasts::Dict{Symbol} = Dict{Symbol,Union{<:AbstractContrasts,<:AbstractTerm}}(),
                 wts::Union{Nothing,Symbol} = nothing,
                 panel::Union{Nothing,Symbol} = nothing,
                 time::Union{Nothing,Symbol} = nothing,
                 vce::VCE = OIM)

Formula has syntax:

@formula(response ~ exogenous + (endogenous ~ instruments) + absorb(highdimscontrols))

Data must implement the Tables.jl API and use CategoricalArrays (CategoricalVector)

Weights are taken as StatsBase.FrequencyWeights

Panel and time indicators are used for longitudinal estimators

Examples

model = fit(EconometricModel, formula, data, kwargs...)
model = fit(BetweenEstimator, formula, data, panel = :panel, kwargs...)
model = fit(RandomEffectsEstimator, formula, data, panel = :panel, time = :time, kwargs...)
Econometrics.RandomEffectsEstimatorType
RandomEffectsEstimator(pid::Tuple{Symbol,Vector{Vector{Int}}},
                       tid::Tuple{Symbol,Vector{Vector{Int}}},
                       idiosyncratic::Float64,
                       individual::Float64,
                       θ::Vector{Float64}) <: LinearModelEstimators

Swamy-Arora estimator.

Econometrics.VCEType
VCE

Variance-covariance estimators.

  • Observed Information Matrix (OIM)
  • Heteroscedasticity Consistent: HC0, HC1, HC2, HC3, HC4
source
Econometrics.absorbFunction
absorb

Function for constructing the FunctionTerm{typeof(absorb)} used in decompose.

Econometrics.decomposeMethod
decompose(f::FormulaTerm,
          data,
          contrasts::Dict{Symbol},
          wts::Union{Nothing,Symbol},
          panel::Union{Nothing,Symbol},
          time::Union{Nothing,Symbol},
          estimator::Type{<:Union{EconometricsModel,ModelEstimator}},
          vce::VCE)

Decomposes the arguments passed to a fit(::EconometricModel) into its components.

Returns

  • data
  • exogenous::FormulaTerm
  • iv::FormulaTerm
  • estimator::ModelEstimator
  • X::Matrix{Float64}
  • y::VecOrMat{<:Union{Bool,Int,Float64}}
  • z::Vector{Float64}
  • Z::Matrix{Float64}
  • wts::FrequencyWeights
Econometrics.obtain_ΩMethod
obtain_Ω(A::AbstractMatrix{<:Real},
         μ::AbstractMatrix{<:Real},
         ω::FrequencyWeights)

Obtain Ω for a multinomial regression by building the matrix by blocks.

Econometrics.partialwithinMethod
partialwithin(obj::AbstractVecOrMat{<:Real},
              D::AbstractVector{<:AbstractVector{<:Integer}},
              θ::AbstractVector{<:Real})

This function performs the partial within transformation given a model matrix subgroups and subgroup specific error components.

Econometrics.transformFunction
transform(estimator::LinearModelEstimators, wts::FrequencyWeights)
transform(estimator::BetweenEstimator, wts::FrequencyWeights)
transform(estimator::ContinuousResponse,
          obj::AbstractVecOrMat{<:Number},
          wts::FrequencyWeights)
transform(estimator::BetweenEstimator,
          obj::AbstractVector{<:Number},
          wts::FrequencyWeights)
transform(estimator::BetweenEstimator,
          obj::AbstractMatrix{<:Number},
          wts::FrequencyWeights)
transform(estimator::RandomEffectsEstimator,
          obj::AbstractVecOrMat,
          wts::FrequencyWeights)

Applies a transformation to a model component based on the model estimator.

Econometrics.waldFunction
wald(obj::EconometricModel, vce::VCE = obj.vce)

Provides the Wald statistic as Wald value, a F-Distribution, and the associated p-value.

Econometrics.withinMethod
within(obj::AbstractMatrix{<:Real},
       D::AbstractVector{<:AbstracVector{<:AbstracVector{<:Integer}}},
       wts::AbstractVector)

This function performs the within transformation given a model matrix and fixed effects using the method of alternating projections.

StatsBase.coeftableMethod
coeftable(obj::EconometricModel;
	  level::Real = 0.95)
coeftable(obj::EconometricModel{<:LinearModelEstimators};
	  level::Real = 0.95,
	  vce::VCE = obj.vce)

Return a table of class CoefTable with coefficients and related statistics. level determines the level for confidence intervals (by default, 95%). vce determines the variance-covariance estimator (by default, OIM).

StatsBase.confintMethod
confint(obj::EconometricModel; se::AbstractVector{<:Real} = stderror(obj), level::Real = 0.95)

Compute the confidence intervals for coefficients, with confidence level level (by default, 95%). se can be provided as a precomputed value.

StatsBase.stderrorMethod
stderror(obj::EconometricModel)
stderror(obj::EconometricModel{<:LinearModelEstimators}, vce::VCE = obj.vce)

Return the standard errors for the coefficients of the model. The vce argument allows to request variance estimators.

StatsBase.vcovMethod
vcov(obj::EconometricModel)
vcov(obj::EconometricModel{<:LinearModelEstimators}, vce::VCE = obj.vce)

Return the variance-covariance matrix for the coefficients of the model. The vce argument allows to request variance estimators.