0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

R > 異なる実装環境で計算した結果を比較 > plot() / cor() / lsfit() + residuals

Last updated at Posted at 2016-09-19
動作環境
RStudio 0.99.903 on Windows 7 pro
R version 3.3.1

異なる実装環境で計算したbook1.csvとtest1.csvの比較。
それぞれ2行目から600行目のデータを使う。

準備:データ読込み

> setwd("d:/TestData/160911_R/")
> x<-read.table("Book1.csv")
> y<-read.table("test1.csv")
> xwrk<-as.numeric(as.matrix(x$V1[2:600]))
> ywrk<-as.numeric(as.matrix(y$V1[2:600]))
> head(xwrk)
[1] 0.000215375 0.001302264 0.000659470 0.000127537
[5] 0.000659040 0.000118265
> head(ywrk)
[1] 0.0002154 0.0013023 0.0006595 0.0001275 0.0006590
[6] 0.0001183

plot()

> plot(xwrk, ywrk)

qiita.png

cor()

> cor(xwrk,ywrk)
[1] 1

lsfit() + residulas

参考 http://cse.naro.affrc.go.jp/takezawa/r-tips/r/70.html

> z<-lsfit(xwrk,ywrk)
> plot(z$residuals)

qiita.png

大きな誤差はなさそう。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?