Skip to contents

Returns a named list of ivreg2_first_stage objects, one per endogenous variable. Each ivreg2_first_stage object supports the following methods:

Usage

first_stage(x, ...)

# S3 method for class 'ivreg2'
first_stage(x, ...)

Arguments

x

A fitted model object.

...

Additional arguments (ignored).

Value

A named list of ivreg2_first_stage objects.

Details

coef()

First-stage coefficient vector.

vcov()

First-stage variance-covariance matrix.

residuals()

First-stage residuals.

fitted()

First-stage fitted values.

nobs()

Number of observations used in the first stage.

confint()

Confidence intervals for the first-stage coefficients.

print()

Compact one-line-per-coefficient display.

summary()

Full first-stage regression table: coefficients, standard errors, t-values, p-values, the first-stage F-statistic, and the partial R-squared (its print() method renders the table).

tidy()

Broom-style tibble with one row per coefficient (term, estimate, std.error, statistic, p.value, and, optionally, confidence limits).

glance()

Broom-style one-row tibble of first-stage fit statistics (sigma, degrees of freedom, F-statistic, partial R-squared, and related diagnostics).

Small-sample correction

the first-stage F-statistic (surfaced via glance() and summary() on each ivreg2_first_stage object) always uses small-sample degrees of freedom, regardless of the main model's small argument. This matches Stata's ivreg2. See ivreg2r-conventions for the full statement of which corrections small controls.

Examples

# Mirrors the Stata `ivreg2` help-file example at line 1325, which
# demonstrates the equivalence of the Kleibergen-Paap rk Wald F and the
# first-stage F with a single endogenous regressor (and, in passing,
# the `savefirst` option that `first_stage = TRUE` corresponds to).
data(mroz)
mroz_work <- subset(mroz, inlf == 1)
fit <- ivreg2(lwage ~ exper + expersq | educ | age + kidslt6 + kidsge6,
              data = mroz_work, vcov = "robust", first_stage = TRUE)
fs <- first_stage(fit)
coef(fs$educ)
#>  (Intercept)        exper      expersq          age      kidslt6      kidsge6 
#> 13.121940433  0.050141381 -0.001765715 -0.012015042  0.725442450 -0.221944688 
summary(fs$educ)
#> 
#> First-stage regression: educ ~ instruments
#> Observations: 428
#> VCV type:     robust
#> 
#> Coefficients:
#>              Estimate Std. Error t value Pr(>|t|)    
#> (Intercept) 13.121940   0.818270  16.036  < 2e-16 ***
#> exper        0.050141   0.045075   1.112  0.26660    
#> expersq     -0.001766   0.001469  -1.202  0.23012    
#> age         -0.012015   0.017442  -0.689  0.49129    
#> kidslt6      0.725442   0.278648   2.603  0.00955 ** 
#> kidsge6     -0.221945   0.092030  -2.412  0.01631 *  
#> ---
#> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#> ---
#> Root MSE:       2.2586 
#> F(3, 422) = 5.02 (p = 0.0020)
#> Partial R2:     0.0299 
#> Shea PR2:       0.0299 
#> 
# KP rk Wald F = the robust first-stage F (single endogenous regressor)
c(kp_rk_wald_F = fit$diagnostics$weak_id_robust$stat,
  first_stage_F = glance(fs$educ)$f_stat)
#>  kp_rk_wald_F first_stage_F 
#>      5.021219      5.021219