rm(list=ls())
t=read.table("artif2.txt");t
test=t[t$V2=="A",];test #筛选V2中的A
fit=lm(V1~V3,test);fit
summary(fit)
plot(test$V1,test$V3,xlab='V3',ylab='V1')
abline(fit)
residuals(fit)
fitted(fit)
rm(list=ls())
t=read.table("artif2.txt");t
test=t[t$V2=="A",];test #筛选V2中的A
fit=lm(V1~V3,test);fit
summary(fit)
plot(test$V1,test$V3,xlab='V3',ylab='V1')
abline(fit)
residuals(fit)
fitted(fit)
本文标题:R语言数据筛选
本文链接:https://www.haomeiwen.com/subject/ijtotttx.html
网友评论