fwl_plot: FWL Plot

View source: R/fwl_plot.R

fwl_plotR Documentation

FWL Plot

Description

This function creates a bivariate plot of y and x after residualizing over a set of covariates w.

Usage

fwl_plot(fml, data, ggplot = FALSE, n_sample = NULL, ...)

fwlplot(fml, data, ggplot = FALSE, n_sample = NULL, ...)

Arguments

fml

Of the form y ~ x + covs | fes following the fixest formula syntax. The x variable you want plotted should come first.

data

A dataframe object that contains the variables in fml.

ggplot

Boolean. Default is to use base R plot but if TRUE, use ggplot.

n_sample

Numeric. Number of observations to sample for each facet. If NULL, will plot all rows.

...

Additional arguments passed to fixest::feols.

Value

Either NULL if ggplot = FALSE or a ggplot object if ggplot = TRUE.

Examples


fwl_plot(mpg ~ hp + wt | cyl, mtcars)



fwlplot documentation built on Oct. 17, 2023, 1:06 a.m.