R Under development (unstable) (2023-06-12 r84534 ucrt) -- "Unsuffered Consequences" Copyright (C) 2023 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > > ### fixed effects models > ### methods and tests contributed by Grant McDermott (@grantmcdermott) > > library("multcomp", quietly = TRUE) Attaching package: 'TH.data' The following object is masked from 'package:MASS': geyser > > fixestOK <- require("fixest", quietly = TRUE) > if (fixestOK) { + lmod <- lm(Sepal.Length ~ Sepal.Width + as.factor(Species), iris) + fmod <- feols(Sepal.Length ~ Sepal.Width + as.factor(Species), iris) + fmod2 <- feols(Sepal.Length ~ Sepal.Width | Species, iris, vcov = "iid") ## see next model too + fmod3 <- feols(Sepal.Length ~ Sepal.Width | Species, iris) ## default vcov is clustered by Species + + glmod <- glht(lmod, "Sepal.Width==0") + gfmod <- glht(fmod, "Sepal.Width==0") + gfmod2 <- glht(fmod2, "Sepal.Width==0") + gfmod3 <- glht(fmod3, "Sepal.Width==0", vcov = "iid") + stopifnot(all.equal(confint(glmod)$confint, confint(gfmod)$confint)) + stopifnot(all.equal(confint(glmod)$confint, confint(gfmod2)$confint)) + stopifnot(all.equal(confint(glmod)$confint, confint(gfmod3)$confint)) + } > > proc.time() user system elapsed 1.06 0.17 1.23