11"""
22 checkvcov!(args...)
33
4- Exclude rows that are invalid for `vcov` .
4+ Exclude rows that are invalid for variance-covariance estimator .
55See also [`CheckVcov`](@ref).
66"""
77checkvcov! (data, esample:: BitVector ,
8- vcov :: Union{Vcov.SimpleCovariance, Vcov.RobustCovariance} ) = NamedTuple (), false
8+ vce :: Union{Vcov.SimpleCovariance, Vcov.RobustCovariance} ) = NamedTuple (), false
99
10- function checkvcov! (data, esample:: BitVector , vcov :: Vcov.ClusterCovariance )
11- esample .&= Vcov. completecases (data, vcov )
10+ function checkvcov! (data, esample:: BitVector , vce :: Vcov.ClusterCovariance )
11+ esample .&= Vcov. completecases (data, vce )
1212 return (esample= esample,), false
1313end
1414
1515"""
1616 CheckVcov <: StatsStep
1717
18- Call [`InteractionWeightedDIDs.checkvcov!`](@ref) to exclude invalid rows for
19- `Vcov.CovarianceEstimator` .
18+ Call [`InteractionWeightedDIDs.checkvcov!`](@ref) to
19+ exclude rows that are invalid for variance-covariance estimator .
2020"""
2121const CheckVcov = StatsStep{:CheckVcov , typeof (checkvcov!)}
2222
2323required (:: CheckVcov ) = (:data , :esample )
24- default (:: CheckVcov ) = (vcov = Vcov. robust (),)
24+ default (:: CheckVcov ) = (vce = Vcov. robust (),)
2525
2626"""
2727 checkfes!(args...)
@@ -336,24 +336,24 @@ const SolveLeastSquares = StatsStep{:SolveLeastSquares, typeof(solveleastsquares
336336required (:: SolveLeastSquares ) = (:tr , :yterm , :xterms , :yxterms , :yxcols , :treatcols ,
337337 :has_fe_intercept )
338338
339- function _vcov (data, esample:: BitVector ,
340- vcov :: Union{Vcov.SimpleCovariance,Vcov.RobustCovariance} , fes:: Vector{FixedEffect} )
339+ function _vce (data, esample:: BitVector ,
340+ vce :: Union{Vcov.SimpleCovariance,Vcov.RobustCovariance} , fes:: Vector{FixedEffect} )
341341 dof_absorb = 0
342342 for fe in fes
343343 dof_absorb += nunique (fe)
344344 end
345- return vcov , dof_absorb
345+ return vce , dof_absorb
346346end
347347
348- function _vcov (data, esample:: BitVector , vcov :: Vcov.ClusterCovariance ,
348+ function _vce (data, esample:: BitVector , vce :: Vcov.ClusterCovariance ,
349349 fes:: Vector{FixedEffect} )
350- cludata = _getsubcolumns (data, vcov . clusters, esample)
351- concrete_vcov = Vcov. materialize (cludata, vcov )
350+ cludata = _getsubcolumns (data, vce . clusters, esample)
351+ concrete_vce = Vcov. materialize (cludata, vce )
352352 dof_absorb = 0
353353 for fe in fes
354- any (c-> isnested (fe, c. refs), concrete_vcov . clusters) && (dof_absorb += 1 )
354+ any (c-> isnested (fe, c. refs), concrete_vce . clusters) && (dof_absorb += 1 )
355355 end
356- return concrete_vcov , dof_absorb
356+ return concrete_vce , dof_absorb
357357end
358358
359359"""
@@ -362,19 +362,19 @@ end
362362Estimate variance-covariance matrix and F-statistic.
363363See also [`EstVcov`](@ref).
364364"""
365- function estvcov (data, esample:: BitVector , vcov :: CovarianceEstimator , coef:: Vector ,
365+ function estvcov (data, esample:: BitVector , vce :: CovarianceEstimator , coef:: Vector ,
366366 X:: Matrix , crossx:: Factorization , residuals:: Vector ,
367367 xterms:: Terms , fes:: Vector{FixedEffect} , has_fe_intercept:: Bool )
368- concrete_vcov , dof_absorb = _vcov (data, esample, vcov , fes)
368+ concrete_vce , dof_absorb = _vce (data, esample, vce , fes)
369369 dof_resid = max (1 , sum (esample) - size (X,2 ) - dof_absorb)
370- vcov_data = Vcov. VcovData (X, crossx, residuals, dof_resid)
371- vcov_mat = getvcov (vcov_data, concrete_vcov )
370+ vce_data = Vcov. VcovData (X, crossx, residuals, dof_resid)
371+ vcov_mat = vcov (vce_data, concrete_vce )
372372
373373 # Fstat assumes the last coef is intercept if having any intercept
374374 has_intercept = ! isempty (xterms) && isintercept (xterms[end ])
375375 F = Fstat (coef, vcov_mat, has_intercept)
376376 has_intercept = has_intercept || has_fe_intercept
377- df_F = max (1 , Vcov. df_FStat (vcov_data, concrete_vcov , has_intercept))
377+ df_F = max (1 , Vcov. df_FStat (vce_data, concrete_vce , has_intercept))
378378 p = fdistccdf (max (length (coef) - has_intercept, 1 ), df_F, F)
379379
380380 return (vcov_mat= vcov_mat, dof_resid= dof_resid, F= F, p= p), true
@@ -390,5 +390,5 @@ may be shared across multiple specifications.
390390"""
391391const EstVcov = StatsStep{:EstVcov , typeof (estvcov)}
392392
393- required (:: EstVcov ) = (:data , :esample , :vcov , :coef , :X , :crossx , :residuals , :xterms ,
393+ required (:: EstVcov ) = (:data , :esample , :vce , :coef , :X , :crossx , :residuals , :xterms ,
394394 :fes , :has_fe_intercept )
0 commit comments