A <- A[,-2]A[,-3]
这也太人性化了,符号就代表相减。
O<-cor(delnan)
corrplot.mixed(O, lower = "number", upper = "circle", tl.col = "black",lower.col = "black", number.cex = 1)
var.test(X,Y,conf.level = 0.95)
F test to compare two variances
data: X and Y
F = 1.2549, num df = 214, denom df = 681, p-value = 0.03517
alternative hypothesis: true ratio of variances is not equal to 1
95 percent confidence interval:
1.015792 1.569904
sample estimates:
ratio of variances
1.254934
P225
t.test(old$total,new$total,alternative = "greater",paired = FALSE)
Welch Two Sample t-test
data: old$total and new$total
t = 2.3204, df = 424.96, p-value = 0.0104
alternative hypothesis: true difference in means is greater than 0
95 percent confidence interval:
0.7398228 Inf
sample estimates:
mean of x mean of y
12.86279 10.30811
F test to compare two variances
data: old$total and new$total
F = 1.6429, num df = 480, denom df = 184, p-value = 0.0001094
alternative hypothesis: true ratio of variances is not equal to 1
95 percent confidence interval:
1.282709 2.076794
sample estimates:
ratio of variances
1.642878
非参数检验
library(ggplot2)
p<-ggplot(old, aes(x = old$total))
#注释:x轴表示weight,y轴表示频率就不需要指定啦
p + geom_density(color = "black", fill = "gray")+ geom_density(aes(color = old$year))
q<-ggplot(new, aes(x = new$total))
q + geom_density(color = "red", fill = "black")+ geom_density(aes(color = new$year))
cbind(new$total,old$total)
p<-ggplot(oldnewdata, aes(x = number))
p + geom_density(color = "black", fill = "gray")
p + geom_density(aes(color = type))
p + geom_density(aes(fill = type), alpha=0.4)
x,y x~y看数据的分布