学習環境
- Surface 3 (4G LTE)、Surface 3 タイプ カバー、Surface ペン(端末)
- Windows 10 Pro (OS)
- Nebo(Windows アプリ)
- iPad Pro + Apple Pencil
- MyScript Nebo(iPad アプリ)
- Numbers - Apple(表計算ソフト)
- Excel(Office 365 Solo)
- R言語(プログラミング言語)
- 参考書籍
Head Firstデータ解析 (Michael Milton (著)、大橋 真也 (監訳)、 木下 哲也 (翻訳)、オライリージャパン)の11章(誤差 - 誤差を適切に示す)、自分で考えてみよう(p. 355)を取り組んでみる。
自分で考えてみよう(p. 355)
-
y = 0.7933468 + 0.9424946 x
y = 7.813403 + 0.302609 x
-
10パーセント以下の昇給を要求した人。
10パーセントより大きい昇給を要求した人。
-
1.374526パーセントの誤差。
4.544424パーセントの誤差。
コード(Emacs)
R言語
#!/usr/bin/env Rscript
url <- "http://www.oreilly.co.jp/pub/9784873114644/hfda_ch10_employees.csv"
employees <- read.csv(url, header=TRUE)
myLmBig <- lm(received[negotiated==TRUE & requested > 10]~
requested[negotiated==TRUE & requested > 10],
data=employees)
myLmSmall <- lm(received[negotiated==TRUE & requested <= 10]~
requested[negotiated==TRUE & requested <= 10],
data=employees)
svg('sample2.svg')
plot(employees$requested[employees$negotiated==TRUE],
employees$received[employees$negotiated==TRUE])
## 積極的な交渉者の回帰式の係数とRMS誤差
summary(myLmSmall)$coefficients
summary(myLmSmall)$sigma
## 臆病な交渉者の回帰式の係数とRMS誤差
summary(myLmBig)$coefficients
summary(myLmBig)$sigma
入出力結果(Terminal)
$ ./sample2.r
Estimate Std. Error t value
(Intercept) 0.7933468 0.22472009 3.530378
requested[negotiated == TRUE & requested <= 10] 0.9424946 0.03151835 29.903041
Pr(>|t|)
(Intercept) 4.378156e-04
requested[negotiated == TRUE & requested <= 10] 6.588020e-134
[1] 1.374526
Estimate Std. Error t value
(Intercept) 7.813403 1.8760371 4.164845
requested[negotiated == TRUE & requested > 10] 0.302609 0.1420151 2.130824
Pr(>|t|)
(Intercept) 4.997597e-05
requested[negotiated == TRUE & requested > 10] 3.457618e-02
[1] 4.544424
$
0 コメント:
コメントを投稿