R语言数据筛选
2014-12-13 本文已影响1157人
Tchenv
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)