ustat_var.varcovar
- ustat_var.varcovar(origX, origY, w=None, quiet=True)
U-stat estimator of variance / covariance for teacher effects X and Y are a J-by-\(\operatorname{max}(T_j)\) matrix of teacher-specific mean residuals. When X and Y are residuals for the same outcome and covariate group, code will return a estimate of variance of teacher effects. When X and Y differ (either in outcome or Xs), code returns an estimate of the covariance.
Each row of X and Y are residuals for a specific teacher, ordered as first year observed, second year observed, etc. Since teachers have different number of years observed, X and Y should be np.NaN for all years after the last year observed. Each teacher must have at least 2 years observed.
X and Y must have the same dimension.
Note: this is a wrapper function that calls varcovar_balanced or varcovar_ustat depending on whether the panels are balanced or unbalanced.
- “varcovar_balanced.py” is used when the panels are balanced, i.e. each teacher appears the same number of times in both X and Y.
“varcovar_ustat.py” is used when the panels are unbalanced, i.e. each teacher appears a different number of times in X and Y.
- origX: array
J-by-\(\operatorname{max}(T_j)\) array containing residuals/data for outcome X
- origY: array
J-by-\(\operatorname{max}(T_j)\) array containing residuals/data for outcome Y
- w: array
(Optional) J-by-1 array of user-supplied weights. If supplied, varcovar will return row-weighted variance-covariance of row means.
- quiet: boolean
(Optional) If quiet=True, function call will report type of variance being calculated (unweighted/weighted) and whether panels are balanced or unbalanced.
- float
Variance-covariance between rowmeans of origX and origY.