Testing Linear Regression Models

A collection of tests, data sets, and examples for diagnostic checking in linear regression models. Furthermore, some generic tools for inference in parametric models are provided.


Changes in Version 0.9-34

o Registered all default methods as S3 methods (in addition to fully exporting them).

o Reference output updated for recent versions of R.

Changes in Version 0.9-33

o Extended license to GPL-2 or GPL-3.

o To make resettest() results numerically more reliable (especially for type = "fitted" when the fitted mean is large), the response is internally scaled.

o The default coeftest() method checks whether coef() and vcov() output has unique names (which they may not have for some model classes, e.g., sampleSelection::selection).

Changes in Version 0.9-32

o Small improvements in residual degrees of freedom computation within default waldtest() method.

o Updated Imports/Suggests to conform with current R CMD check.

Changes in Version 0.9-31

o Included Farebrother/Cummins as "aut" in DESCRIPTION for pan.f Fortran code.

o Made starting values in the auxiliary regression of bgtest() optional. By default still 0, but could also be NA.

o Avoid spurios errors about missing nobs() methods in lrtest().

Changes in Version 0.9-30

o coeftest(), lrtest(), and waldtest() can now also be used for S4 objects provided that methods to the corresponding S4 generics from stats4 are supplied.

o Added output of examples and vignettes as .Rout.save for R CMD check.

o Moved vignette to "vignettes" directory in source package.

Changes in Version 0.9-29

o dwtest() now catches weighted regressions and throws an error because weighted regressions are not supported (yet).

o bgtest() now returns an object of class "bgtest" (inheriting from "htest"). This has coef(), vcov() and df.residual() methods - and thus enable calling coeftest() - to show the results of the auxiliary regression.

Changes in Version 0.9-28

o Fixed typo in print output of dwtest() for two-sided alternatives.

o Fixed problem in coeftest() method for "breakpointsfull" objects (from strucchange). The vcov() method was not called correctly, resulting in an error.

Changes in Version 0.9-27

o Modified grangertest() default method to workaround a bug in as.zoo().

Changes in Version 0.9-26

o added coeftest() method for "mlm" objects (needed for matching coef() output to vcov() method)

Changes in Version 0.9-25

o enhanced documentation for new Rd parser.

Changes in Version 0.9-24

o Added new specification test: PE test for linear vs. log-linear specification in linear regressions is now available as petest().

Changes in Version 0.9-23

o enhanced documentation for new Rd parser.

Changes in Version 0.9-22

o included lmtest.bib in inst/doc for vignette.

o removed \itemize in .Rd files for new R-devel.

Changes in Version 0.9-21

o corrected degrees of freedom for bgtest(..., type = "F") (bug spotted by Oscar Becerra).

Changes in Version 0.9-20

o fixed error in Mandible data. Mandible[158,2] was 34 but should really be 37 (see Table 1 in Royston & Altman 1994). Spotted by Christian Ritz.

Changes in Version 0.9-19

o changed the default behaviour of waldtest.default(): Chisq test (instead of F test) is now used by default which is more sensible for most models (with linear models as a notable exception).

o added waldtest.lm() method that switches the default test back to F test (instead of Chisq test).

Changes in Version 0.9-18

o forgot to export print() method for "coeftest" objects

Changes in Version 0.9-17


o improved dependency declaration in DESCRIPTION

Changes in Version 0.9-16

o updated all .rda data sets to RDX2

o enhanced sanity checking in dwtest()

Changes in Version 0.9-15

o new generic with flexible default method for lrtest(), implementing asymptotic likelihood ratio tests. This works if a logLik() method is provided and suitable methods for updating models and checking consistency.

o simplified print output in coeftest()

Changes in Version 0.9-14

o now a default method for waldtest() is provided (replacing the lm method). It works for "lm", "glm" and "survreg" objects.
Furtheremore, it is object-oriented and generally works if the following methods are available: terms(), formula(), coef() (which needs to be named, matching the names in terms() and vcov()), vcov() (which can alternatively be user-supplied), df.residual(), residuals() and update() (unless only fitted objects are supplied).

o the default coeftest() was enhanced, works now out of the box for "mle" objects, a "survreg" method is added (needed because coef() and vcov() do not necessarily match for "survreg" objects).

o the vcov argument was changed (almost) everywhere to vcov. to avoid name clashes with the vcov() function.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


0.9-35 by Achim Zeileis, 15 days ago

Browse source code at https://github.com/cran/lmtest

Authors: Torsten Hothorn [aut], Achim Zeileis [aut, cre], Richard W. Farebrother [aut] (pan.f), Clint Cummins [aut] (pan.f), Giovanni Millo [ctb], David Mitchell [ctb]

Documentation:   PDF Manual  

Task views: Econometrics, Empirical Finance, Statistics for the Social Sciences

GPL-2 | GPL-3 license

Imports graphics

Depends on stats, zoo

Suggests car, strucchange, sandwich, dynlm, stats4, survival, AER

Imported by AutoModel, BETS, BinaryEPPM, DHARMa, MRMR, REndo, betareg, chipPCR, clusterSEs, dynlm, earlywarnings, elementR, fRegression, forecast, gcmr, georob, glmx, mlogit, mnlogit, pdR, plm, rcompanion, rddtools, sjstats, smoothAPC, termstrc, treeclim, vcd.

Depended on by AER, PeerPerformance, cjoint, dcv, erer, fpp, frontier, gravity, ivlewbel, ivpack, mfx, micEconAids, orcutt, rdd, systemfit, vars.

Suggested by FSA, FactorsR, FinTS, IPSUR, R2MLwiN, Rchoice, Rcmdr, RcmdrPlugin.IPSUR, broom, car, censReg, crch, ctqr, fxregime, gmnl, meboot, multcomp, multiwayvcov, oglmx, pglm, pscl, psychomix, sampleSelection, sandwich, sjPlot, strucchange, vcdExtra.

Enhanced by stargazer, texreg.

See at CRAN