View source: R/generics_vcov.R
vcov.felm | R Documentation |
Covariance matrix for the estimator of the structural parameters
from objects returned by felm
. The covariance is computed
from the hessian, the scores, or a combination of both after convergence.
## S3 method for class 'felm'
vcov(
object,
type = c("hessian", "outer.product", "sandwich", "clustered"),
...
)
object |
an object of class |
type |
the type of covariance estimate required. |
... |
additional arguments. |
A named matrix of covariance estimates.
felm
# same as the example in felm but extracting the covariance matrix
# subset trade flows to avoid fitting time warnings during check
set.seed(123)
trade_2006 <- trade_panel[trade_panel$year == 2006, ]
trade_2006 <- trade_2006[sample(nrow(trade_2006), 500), ]
mod <- felm(
trade ~ log_dist + lang + cntg + clny | exp_year + imp_year | pair,
trade_2006
)
round(vcov(mod, type = "clustered"), 5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.