My data looks like this
data <- structure(list(code = 1:12, outcome1 = c(75L, 76L, 77L, 78L,
80L, 82L, 85L, 84L, 78L, 84L, 84L, 75L), outcome2 = c(50L, 55L,
54L, 52L, 56L, 58L, 59L, 54L, 52L, 56L, 56L, 57L), response1 = c(1500L,
1800L, 1789L, 1200L, 1400L, 1900L, 1800L, 1100L, 1450L, 1750L,
1770L, 1000L), response2 = c(100L, 111L, 120L, 140L, 144L, 156L,
147L, 189L, 165L, 154L, 132L, 171L)), class = "data.frame", row.names = c(NA,
-12L))
I have numerous outcomes = 8 and response variables = 22.
I would like to create a series of regression plots for all outcome * response combination. Is there a fast and easy way to do this?
For example: Outcome1 * Response1, Outcome1 * Response 2, Outcome2 * Response1 and so on.
This is an example code for creating one such outcome1 by response1 graph.
ggplot(data = data, aes(x = outcome1, y = response1)) +
geom_point(color='blue') +
geom_smooth(method = "lm", se = FALSE)
Edit: I have thought about faceting but this may not work here because, for each outcome(x) the various responses(y) are in different units. So y axis scales are not comparable across different (y).