密度累计图
2020-05-18 本文已影响0人
余绕
#密度累计图
library(ggplot2)
rm(list = ls())
circ=read.csv("Documents.csv")
circ=as.data.frame(circ)
head(circ)
par(pty='s') # force the plot to be square before we start
x1.cdf=ecdf(circ$CK1) #累计密度
x2.cdf=ecdf(circ$CK2) #累计密度
x3.cdf=ecdf(circ$Infection1)
x4.cdf=ecdf(circ$Infection2)
x1.cdf
x2.cdf
plot(x1.cdf,col="red",lwd=2)
lines(x2.cdf,col="darkviolet ",lwd=7)
lines(x3.cdf,col="gold3 ",lwd=7)
lines(x4.cdf,col="darkturquoise ",lwd=7)+theme(text=element_text(size=10, family="sans"))
ks.test(circ$CK2,circ$Infection2)