R 一个图中的多元线性回归(ggplot2)

R 一个图中的多元线性回归(ggplot2),r,ggplot2,plot,linear-regression,R,Ggplot2,Plot,Linear Regression,我试图在一个图中绘制4个线性回归! 我在比较历年来的高等教育入学率时,将1分为两部分。高收入国家,2。中上收入国家,3。中低收入国家和4个。低收入国家 到目前为止,我得到的是 t <- ggplot(painel_df, aes(Year, E.tertiary, colour=income_group, fill=income_group)) + geom_smooth(method="lm") + geom_point(size=0.2) + theme

我试图在一个图中绘制4个线性回归! 我在比较历年来的高等教育入学率时,将1分为两部分。高收入国家,2。中上收入国家,3。中低收入国家和4个。低收入国家

到目前为止,我得到的是

t <- ggplot(painel_df, aes(Year, E.tertiary, colour=income_group, fill=income_group)) +
  geom_smooth(method="lm") +
  geom_point(size=0.2) +
  theme_bw() + 
  xlab("Years") +
  ylab("School enrollments, tertiary (%gross)") 

plot(t)

t尝试将
Years
更改为数字,或将
group=income\u group
添加到
aes
中作为数值!非常感谢。