> qqplot(spear,fastrankweight)
> qqplot(spear,fastrankweight,main="title")
> qqplot(spear,fastrankweight,main="distribution relation between spearman and fastrank")
> cor(spear,fastrankweight,method="pearson")
[1] 0.3001109
> cor(spear,fastrankweight,method="spearman")
[1] -0.01457876
> cor(spear,fastrankweight,method="kendall")
[1] -0.002459491

 data2=read.table("D:\\WorkSpace\\TestData\\20170929\\feats2.tsv",header=T)

 

 

 

Call:
lm(formula = y ~ x, data = data1)

Residuals:
    Min      1Q  Median      3Q     Max
-188.34  -54.64   -3.18   24.25 1447.13

Coefficients:
            Estimate Std. Error t value Pr(>|t|)   
(Intercept)   -71.35      29.76  -2.397   0.0183 * 
x             612.67     123.80   4.949 2.96e-06 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 171.1 on 102 degrees of freedom
Multiple R-squared:  0.1936,    Adjusted R-squared:  0.1857
F-statistic: 24.49 on 1 and 102 DF,  p-value: 2.957e-06

> coefficient<-lm.data1$coefficients
> coefficient[1]
(Intercept)
  -71.34905
> coefficient[2]
      x
612.669
> ARsquared<-summary(lm.data1)$adj.r.squared
> ks.test(lm.data1$residuals,"pnorm",0)

        One-sample Kolmogorov-Smirnov test

data:  lm.data1$residuals
D = 0.51524, p-value < 2.2e-16
alternative hypothesis: two-sided

> ab<-round(lm.data1$coefficients[1],3)
> bb<-round(lm.data1$coefficients[2],3)
> plot(data1$x,data1$y,xlab="x",ylab = "y",col="red",pch="*")
> abline(lm.data1,col="blue")
> text(mean(data1$x),max(data1$y),paste("y = ",bb,"x+(",ab,")",sep = ""))
>

posted on 2017-09-30 10:01  finallyly  阅读(1302)  评论(0编辑  收藏  举报