Learn R Programming

partialling.out (version 0.2.0)

plot_partial_residuals: plot_partial_residuals: scatterplot of partial residuals

Description

Function for plotting partial residuals Uses tinyplot as backend

Usage

plot_partial_residuals(x, add_lm = TRUE, quantile = FALSE, probs = 0.02, ...)

Value

invisibly, x

Arguments

x

a partial_residuals objects from partialling_out()

add_lm

if TRUE, a lm will be plotted

quantile

if TRUE, will plot only the mean values of the quantiles of the mean explanatory variable specified by probs

probs

numeric vector of length one that specifies the number of quantiles to be computed if quantile is TRUE. by default, 0.02, which will give 50 quantiles.

...

Any other tinyplot::plt() params

Examples

Run this code
library(palmerpenguins)
library(fixest)
model <- feols(bill_length_mm ~ bill_depth_mm | species + island,
               data = penguins)
partial_df <- partialling_out(model, penguins, both = TRUE)
plot_partial_residuals(partial_df)

Run the code above in your browser using DataLab