Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for ggcoefplot #28

Merged
merged 15 commits into from
Dec 4, 2023
Merged

Add support for ggcoefplot #28

merged 15 commits into from
Dec 4, 2023

Conversation

grantmcdermott
Copy link
Owner

This PR adds (gg)coefplot support alongside the existing (gg)iplot functionality.

Quick examples from updated help docs.

pkgload::load_all("~/Documents/Projects/ggiplot/")
#> ℹ Loading ggiplot
#> Loading required package: ggplot2
library(fixest)

##
# basic use

est = feols(
    Petal.Length ~ Petal.Width + Sepal.Length + Sepal.Width + Species,
    data = iris
    )

ggcoefplot(est)

# You can use the argument group to group variables
# You can further use the special character "^^" to clean
#  the beginning of the coef. name: particularly useful for factors

# now we group by Sepal and Species
ggcoefplot(est, group = list(Sepal = "Sepal", Species = "Species"))

# now we group + clean the beginning of the names using the special character ^^
ggcoefplot(est, group = list(Sepal = "^^Sepal.", Species = "^^Species"))

##
# comparison of ggcoefplot and ggiplot

data(base_did)
base_inter = base_did

# We interact the variable 'period' with the variable 'treat'
est_did = feols(y ~ x1 + i(period, treat, 5) | id + period, base_inter)

# In the estimation, the variable treat is interacted
#  with each value of period but 5, set as a reference

# ggcoefplot will show all the coefficients:
ggcoefplot(est_did)

# ggiplot just shows the interactions
ggiplot(est_did)

Created on 2023-12-03 with reprex v2.0.2

@grantmcdermott grantmcdermott changed the title [WIP] coefplot Add suppport for ggcoefplot Dec 4, 2023
@grantmcdermott grantmcdermott changed the title Add suppport for ggcoefplot Add support for ggcoefplot Dec 4, 2023
@grantmcdermott grantmcdermott merged commit b8efe05 into main Dec 4, 2023
3 checks passed
@grantmcdermott grantmcdermott deleted the coefplot branch December 4, 2023 03:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant