y=c(3.5,1.0, 4.0,2.0,1.0, 3.0,4.5, 1.5, 3.0, 5.0)
#线性回归
fit=lm(y~x)
summary(fit)
# Call:
# lm(formula = y ~ x)
#
# Residuals:
# Min 1Q Median 3Q Max
# -0.83899 -0.33483 0.07842 0.37228 0.52594
#
# Coefficients:
# Estimate Std. Error t value Pr(>|t|)
# (Intercept) 0.1181291 0.3551477 0.333 0.748
# x 0.0035851 0.0004214 8.509 2.79e-05 ***
# ---
# Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#
# Residual standard error: 0.48 on 8 degrees of freedom
# Multiple R-squared: 0.9005, Adjusted R-squared: 0.8881
# F-statistic: 72.4 on 1 and 8 DF, p-value: 2.795e-05
#画图
plot(x,y,pch=16,cex=0.5)
abline(lm(y~x),col='red')
# 相关性
cor(x,y)
#[1] 0.9489428
结论:签发的新保单数目和加班时间成正比,加班时间越多,签单数越多,两者的相关性大。


雷达卡



京公网安备 11010802022788号







