plot.qed_rdd: Plotting Utilities for QED_RDD objects

Description Usage Arguments Details Value Examples

View source: R/plot.qed_rdd.R

Description

provides convenient plot method for qed_rdd objects

Usage

1
2
## S3 method for class 'qed_rdd'
plot(rdd_ls, cutoff = 0, interaction = TRUE)

Arguments

cutoff

numeric, the cutoff criterion; default is 0 as qed_rdd will by default transform covariate x to (x - cutoff_score)

interaction

boolean, whether or not to allow for slope to be different between treatment and control

df

object of type qed_rdd

Details

One can add and edit plot using the ggplot functions, such as using xlab or ylab to change the x and y labels.

The function automatically plots a line at the discontinuity if you kept the qed_rdd default of transforming the x variable to center the discontinuity at zero; otherwise, you must specify the discontinuity yourself.

By default the plot allows for an interaction effect between x and the treatment; one can however set this to false.

Value

a ggplot object

Examples

1
2
3
4
5
6
7
## Not run: 
data(mlda)
fit <- qed_rdd("mva", "agecell", 21, mlda)
plot(fit)
plot(fit, interaction = FALSE)

## End(Not run)

marginal-latte/QEDinfR documentation built on Dec. 23, 2021, 10:15 p.m.