Is there a Package i need to install to get coeftest in R?

11,495

The package lmtest contains a function called coeftest, that seems to be what you are looking for.

Installing that package should solve your issue.

install.packages("lmtest")
Share:
11,495

Related videos on Youtube

Steve Dee
Author by

Steve Dee

Updated on June 04, 2022

Comments

  • Steve Dee
    Steve Dee almost 2 years

    I am trying to get the HC standard errors from a set of data using

    coeftest(Partc, df = Inf, vcov = vcovHC(fm1, type = "HC1"))
    

    but it returns the error:

    Error in coeftest(Partc, df = Inf, vcov = vcovHC(fm1, type = "HC1")) : 
       could not find function "coeftest"
    

    Am I missing the package required to do this?

    • Allan Cameron
      Allan Cameron about 4 years
      Here is the first hit on a google search for "r function coeftest", suggesting you need to install.packages("lmtest")
  • Ben Bolker
    Ben Bolker about 4 years
    don't forget to run library("lmtest") after you do the installation. (Installation needs to be done only once per computer/R installation, library() needs to be done in each new session.) install.packages("sos"); findFn("coeftest") can help for these kinds of problems in the future.