Vẽ biểu đồ quan hệ 2 biến dùng poit by size
setwd("D:/Dropbox/Nghien cuu dinh luong/Dao tao/Bai giang/Khoa hoc R")
pan<-read.csv("Panel data ve hinh.csv")
library(tidyverse)
## Loading tidyverse: ggplot2
## Loading tidyverse: tibble
## Loading tidyverse: tidyr
## Loading tidyverse: readr
## Loading tidyverse: purrr
## Loading tidyverse: dplyr
## Conflicts with tidy packages ----------------------------------------------
## filter(): dplyr, stats
## lag(): dplyr, stats
library(ggrepel)
library(ggthemes)
nam2015<-pan %>% filter(year==2015)
p1<-ggplot(nam2015,aes(ROE,GCR,col=id,size=NIM))+geom_point(alpha=1,show.legend = FALSE)+scale_size(rang=c(0,20))
p2<-p1+ scale_x_continuous(limits = c(0, 0.20000),breaks = seq(0.01, 1, by = 0.05))
p3<-p2+ scale_y_continuous(limits = c(0, 35),breaks = seq(5, 35, by = 10))
p4<-p3+geom_text_repel(size=3,aes(label=id),colour="black",force=10)
p4
