Home > Software design >  0 and 1 on diagram ggplot
0 and 1 on diagram ggplot

Time:09-29

My data is

   black wage
1      0  769
2      0  808
3      0  825
4      0  650
5      0  562
6      1 1400
7      0  600
8      0 1081
9      0 1154
10     0 1000

my code is

b <- lm(wage~black, y)

ggplot(b, aes(black, wage))   
  geom_point()  
  stat_smooth(method = "lm", col = "red", se = F)  
  theme_minimal()  
  labs(x = '黑人', y = '薪水')  
  theme_minimal()  
  theme(text = element_text(family='黑體-繁 中黑'),
        plot.title = element_text(size = rel(2.5), face = 'bold', hjust = 0.5),
        axis.title = element_text(size = rel(1.5), face = 'bold'),
        axis.text = element_text(size = rel(2), face = 'bold', colour = 'Black'),
        panel.grid.minor.y = element_line(colour = NA))

regression plot

enter image description here

  • Related