Emulate ggplot using plot(): logit regression

I find using ggplot for logistic regression confusing, and I’ve already spent quite some time coding my own template for logit regression in the past, so here’s a quick “fix” to make your simple plots produced by plot() emulate ggplot!

Why would one bother to do this?

Because whoever doesn’t think iris blue (#00BFC4) is pretty has a problem.

The coral-ish color can be defined by col=rgb(248/256, 118/256, 109/256), and the iris blue can be defined by col=rgb(0, 191/256, 196/256).

The figure below was generated by (1) first plotting the raw data of response variable and its covariates while suppressing all labels (specifically, “ann” and “axes”), and (2) then adding the logit plot to the original one using “par(new=TRUE)”

Maybe it saves more time if I just spend ten minutes reading ggplot’s grammar while plotting logit regression…


Figure: Emulating ggplot using plot()

Screen Shot 2016-08-21 at 2.40.37 PM


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s