Visualization of the relationship between x and y, after partialling out
idid_viz_bivar.RdMakes a bivariate graph to visualize the data and relationship between the outcome and the variable of interest, after having partialLed out controls.
Value
A ggplot2 scatter plot and regression line of the relationship between the outcome and the variable of interest, after partialling out controls.
Examples
reg_few_ctrl <- ggplot2::txhousing |>
lm(formula = log(sales) ~ median)
idid_viz_bivar(reg_few_ctrl, "median")
#> Warning: Removed 617 rows containing non-finite outside the scale range
#> (`stat_smooth()`).
#> Warning: Removed 617 rows containing missing values or values outside the scale range
#> (`geom_point()`).
reg_more_ctrl <- ggplot2::txhousing |>
lm(formula = log(sales) ~ median + listings + city + as.factor(date))
idid_viz_bivar(reg_more_ctrl, "median")
#> Warning: Removed 1434 rows containing non-finite outside the scale range
#> (`stat_smooth()`).
#> Warning: Removed 1434 rows containing missing values or values outside the scale range
#> (`geom_point()`).