CR3 Standard Errors
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 30/100
Research direction
Start with the issue's vcov3 function and inspect fixest:::fetch_data, object$fml_all, and object$call to understand how clustered variance-covariance calculations are structured. Check how unit-specific trends are represented and where an additional CR3 estimator would belong; done means CR3 standard errors work for the described fixest objects, with validation against the cited jackknife formula.
Written by the indexing model from the issue text.
Description
Hi, and thanks for a fantastic package!
@s3alfisc recently helped me with the following function, which calculates CR3 standard errors for a fixest object.
The CR3 SE can be estimated using a Jackknife, see Equation 18 of MacKinnon et al (2023).
The summclust package provides support for these SEs, but it doesn't work on fixest objects that are estimated with unit specific trends.
@s3alfisc suggested posting here, in case its useful to others, or could be incorporated into fixest in the future.
Thanks so much!
vcov3 = function(object, cluster){
data = fixest:::fetch_data(object)
data = as.data.frame(data)
cluster = data[,cluster]
unique_cluster = as.vector(unique(cluster))
G = length(unique(cluster))
fml_all = object$fml_all
obj_call = object$call
obj_call$data = quote(data[cluster != g,])
beta_centered = lapply(c(unique_cluster), function(g) coef(eval(obj_call)) - coef(object))
vcov = lapply(seq_along(unique_cluster), function(g) tcrossprod(as.matrix(beta_centered[[g]])))
vcov = Reduce("+", vcov) * (G-1)/G
vcov
}
- Dominant language
- R
- Stars
- 464
- Forks
- 82
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 12
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from lrberge/fixest
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
lrberge/fixest#686 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
lrberge/fixest#713 · 1 comment ·
Maintainers usually reply within 1 day
-
etable notes spacingOpen
Difficulty 3/5 Half a day Newbie friendliness 50/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 47/100
lrberge/fixest#689 · 1 comment ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 86/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
bug dependencies R
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
enhancement needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
JamesHWade/graft#142 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100