首页 > 解决方案 > R:减少分位数回归结果中的图数

问题描述

通过使用以下代码,我可以绘制分位数回归模型的结果:

quant_reg_all <- rq(y_quant ~ X_quant, tau = seq(0.05, 0.95, by = 0.05), data=df_lasso)
quant_plot <- summary(quant_reg_all, se = "boot")
plot(quant_plot)

然而,由于有许多变量,这些图是不可读的,如下图所示: 在此处输入图像描述

包括标签,我有 18 个变量。

我怎么能在当时绘制其中一些图像以便它们可读?

标签: rplotquantileepsquantile-regression

解决方案


根据您无法使用的图表数量,您可以执行以下操作:

quant_reg_all <- rq(y_quant ~ X_quant, tau = seq(0.05, 0.95, by = 0.05), data=df_lasso)
quant_plot <- summary(quant_reg_all, se = "boot")
plot(quant_plot, 1:3)# plot the first 3
plot(quant_plot, c(3, 6, 9, 10))# plot the 3rd, 6th, 9th and 10th plots

推荐阅读