728x90
반응형
회귀직선
-
[R] 산점도, 회귀직선, 회귀식, R^2 값 구하기Study 2021. 6. 8. 01:04
(group=unique(Total$Treatment)) equations=c() for(i in 1:length(group)){ subdata=Total[Total$Treatment==group[i],] fit=lm(pH~day,data=subdata) temp=paste("y=",round(fit$coef[2],6),"*x+",round(fit$coef[1],3)) equations=c(equations,temp) } equations