4
I want to join the three graphs below using the function plot
. I do the basics starting with the command par(mfrow=c(1,3))
but I can’t get them together.
The problem I believe is the fact that I’m using a direct Summary object from quantic regression.
Could you guys help me out on this?
library(quantreg)
data(engel)
x1 <- engel$income
x2 <- 0.5*engel$income*2^(0.3)
x3 <- engel$income*3^(2)
fit1 <- rq(foodexp ~ x1, tau=seq(0.05, 0.95, by = 0.05), method="br", data=engel)
fit2 <- rq(foodexp ~ x2, tau=seq(0.05, 0.95, by = 0.05), method="br", data=engel)
fit3 <- rq(foodexp ~ x3, tau=seq(0.05, 0.95, by = 0.05), method="br", data=engel)
fit1_betas <- summary(fit1, se="iid")
fit2_betas <- summary(fit2, se="iid")
fit3_betas <- summary(fit3, se="iid")
par(mfrow=c(1,3))
plot(fit1_betas, parm=2, main=expression("Regression": beta[0]), ylab="beta", xlab = "tau", cex=1, pch=20)
plot(fit2_betas, parm=2, main=expression("Regression": beta[0]), ylab="beta", xlab = "tau", cex=1, pch=20)
plot(fit3_betas, parm=2, main=expression("Regression": beta[0]), ylab="beta", xlab = "tau", cex=1, pch=20)
Daniel, thank you again! A correction (?) on the last line would be
term´ ao invés de
id . Right??– Linkman
I’m glad it helped! I think it works with both, but really with
term
looks better.– Daniel Falbel