You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#1. Develop a linear model to predict the rain, using all attributes (hint: you can write the formula this way: lm(rain~., data = fire) to indicate you are using all attributes)
165
-
165
+
lm.rain<- lm(rain~., data=fire)
166
166
#2. Look at the summary of the model. Which attributes are statistically significant? (with p-value < 0.05)
167
-
167
+
summary(lm.rain)
168
168
#3. Develop a linear model only using attributes that are statistically significant
169
-
169
+
lm.rain.reduced<- lm(rain~day+temp+RH, data=fire)
170
170
#4. Compare model 1 and model 3. Are they statistically different? Which one would you choose?
171
+
summary(lm.rain)
172
+
summary(lm.rain.reduced)
173
+
anova(lm.rain,lm.rain.reduced) #Not statistically different because anova gives a p-value of 0.515. Choose the simpler model to avoid overfitting
171
174
172
175
#5. Split the dataset into trainning and testing set. Then use the training set to train the model you selected.
0 commit comments