首页 > 解决方案 > 如何在虚拟变量散点图上叠加拟合线?

问题描述

我试图在每个虚拟变量上画一条线,但不知道该怎么做?谁能指出我正确的方向?

# label points by ’type’ on scatterplot
         > plot(education, prestige, pch=as.numeric(type), col=as.numeric(type))
         # add a legend to the above plot
         > legend(8,95, levels(type), pch=1:3, col=1:3)

在此处输入图像描述

标签: rlinear-regressiondummy-variable

解决方案


推荐阅读