R语言命令汇总

> 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 = ""))
>

转载于:https://www.cnblogs.com/finallyliuyu/p/7613818.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值