如何为分位数回归图中的每个变量添加 xlab 和 ylab 的名称?

How can I add name of xlab and ylab for each variable in Quantile regression plot?

我编写这段代码是为了找到带有 X 轴标签和 Y 轴标签的分位数回归图。但它只给出没有轴标签的图。如何为每个变量找到带有轴标签的图。

library(quantreg)

quantile <- c(0.10, 0.20, 0.45, 0.70, 0.90)

fitqr <- rq(logbmi ~ age + total_children_born + education + 
              wealth + Residence + Region + Husband_educ + cur_work, 
            data=dat, tau=quantile , method="fn")
plot(summary(fitqr), lwd=1, pch=20 , cex=1.5, xlab="quantile", 
     ylab="coefficient")

您可能需要使用 mar 选项扩大边距,例如mar=c(5.1, 4.1, 2.1, 2.1).

例子

plot(summary(rq(Sepal.Length ~ Petal.Length + Petal.Width + 
                  Species, tau=quantile, method="fn", data=iris)),
     xlab="tau", ylab="coefficient", mar=c(5.1, 4.1, 2.1, 2.1))