0
0

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.

組み込みデータセットairqualityを使って重回帰

Posted at

Rではlm関数を使って線形回帰を行うことができる。
今回はairqualityデータセットを使って
試しに使ってみる。

head(airquality)
Ozone Solar.R Wind Temp Month Day
1 41 190 7.4 67 5 1
2 36 118 8.0 72 5 2
3 12 149 12.6 74 5 3
4 18 313 11.5 62 5 4
5 NA NA 14.3 56 5 5
6 28 NA 14.9 66 5 6
Data=na.omit(airquality)
Data=subset(airquality,select=c(Ozone,Wind,Temp))
lm(Ozone~Wind+Temp,data=Data)

Call:
lm(formula = Ozone ~ Wind + Temp, data = Data)

Coefficients:
(Intercept) Wind Temp
-71.033 -3.055 1.840

0
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?