R/vcovPC.R

# 
# vcovPC.R
# function to produce panel-corrected variance covariance matrices for use in coeftest
# 

vcovPC <- function(x, ...){
  UseMethod("vcovPC")
}

vcovPC.default <- function(x, groupN, groupT, pairwise=FALSE, ...){
  mf <- match.call()
  if (is.null(groupN) | is.null(groupT)){
    stop("You must provide groupN or groupT. Call: ", mf, ".")
  }
  pc <- pcse(object=x, groupN=groupN, groupT=groupT, pairwise=pairwise)
  return(pc$vcov)
}

Try the pcse package in your browser

Any scripts or data that you put into this service are public.

pcse documentation built on May 2, 2019, 9:16 a.m.