── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr 1.1.4 ✔ readr 2.1.5
✔ forcats 1.0.0 ✔ stringr 1.5.1
✔ ggplot2 3.5.1 ✔ tibble 3.2.1
✔ lubridate 1.9.3 ✔ tidyr 1.3.1
✔ purrr 1.0.2
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors

library(data.table)

Attaching package: 'data.table'
The following objects are masked from 'package:lubridate':
hour, isoweek, mday, minute, month, quarter, second, wday, week,
yday, year
The following objects are masked from 'package:dplyr':
between, first, last
The following object is masked from 'package:purrr':
transpose

library(sandwich)library(jtools)library(lmtest)

Loading required package: zoo
Attaching package: 'zoo'
The following objects are masked from 'package:data.table':
yearmon, yearqtr
The following objects are masked from 'package:base':
as.Date, as.Date.numeric

library(estimatr)library(wooldridge)library(AER)

Loading required package: car
Loading required package: carData
Attaching package: 'car'
The following object is masked from 'package:dplyr':
recode
The following object is masked from 'package:purrr':
some
Loading required package: survival

library(car)library(openintro)

Loading required package: airports
Loading required package: cherryblossom
Loading required package: usdata
Attaching package: 'openintro'
The following object is masked from 'package:survival':
transplant
The following object is masked from 'package:car':
densityPlot
The following object is masked from 'package:wooldridge':
prison
The following object is masked from 'package:jtools':
movies

Original model not retained as part of coeftest object. For additional model summary information (r.squared, df, etc.), consider passing `glance.coeftest()` an object where the underlying model has been saved, i.e.`lmtest::coeftest(..., save = TRUE)`.
This message is displayed once per session.

Model 1

Model 2

Model 3

Model 4

(Intercept)

-1.14

-1.14

-1.14

-1.14

(0.66)

(0.75)

(0.76)

(0.74)

educ

0.53 ***

0.53 ***

0.53 ***

0.53 ***

(0.05)

(0.06)

(0.06)

(0.06)

tenure

0.15 ***

0.15 ***

0.15 ***

0.15 ***

(0.02)

(0.03)

(0.03)

(0.03)

female

-1.71 ***

-1.71 ***

-1.71 ***

-1.71 ***

(0.27)

(0.25)

(0.25)

(0.25)

married

0.69 *

0.69 **

0.69 **

0.69 **

(0.27)

(0.25)

(0.25)

(0.25)

N

526

526

526

526

R2

0.37

0.37

*** p < 0.001; ** p < 0.01; * p < 0.05.

bptest(model_wage)

studentized Breusch-Pagan test
data: model_wage
BP = 43.443, df = 4, p-value = 8.373e-09

linearHypothesis(model_wage, "educ = 0", type =c("F"))

Linear hypothesis test:
educ = 0
Model 1: restricted model
Model 2: wage ~ educ + tenure + female + married
Res.Df RSS Df Sum of Sq F Pr(>F)
1 522 5652.7
2 521 4545.2 1 1107.6 126.96 < 2.2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

linearHypothesis(model_wage, c("educ = 0", "female = 0"), type =c("F"))

Linear hypothesis test:
educ = 0
female = 0
Model 1: restricted model
Model 2: wage ~ educ + tenure + female + married
Res.Df RSS Df Sum of Sq F Pr(>F)
1 523 6137.7
2 521 4545.2 2 1592.6 91.275 < 2.2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1