powered by
This function creates a bivariate plot of y and x after residualizing over a set of covariates w.
y
x
w
fwl_plot(fml, data, ggplot = FALSE, n_sample = NULL, ...)fwlplot(fml, data, ggplot = FALSE, n_sample = NULL, ...)
fwlplot(fml, data, ggplot = FALSE, n_sample = NULL, ...)
Either NULL if ggplot = FALSE or a ggplot object if ggplot = TRUE.
ggplot = FALSE
ggplot = TRUE
Of the form y ~ x + covs | fes following the fixest formula syntax. The x variable you want plotted should come first.
y ~ x + covs | fes
A dataframe object that contains the variables in fml.
dataframe
fml
Boolean. Default is to use base R plot but if TRUE, use ggplot.
Numeric. Number of observations to sample for each facet. If NULL, will plot all rows.
Additional arguments passed to fixest::feols.
fixest::feols
# \donttest{ fwl_plot(mpg ~ hp + wt | cyl, mtcars) # }
Run the code above in your browser using DataLab