Once again the obvious choice for a column worth modeling is the earthquake’s magnitude. Earthquakes with magnitude at least 7 are typically considered major earthquakes, so that is the binary variable that will be used for this model.

The only variables worth investigating as explanatory variables for this variable are latitude, longitude, depth, and time - all other variables are either determined by one of these or have no impact on the earthquake itself and thus would be unhelpful as predictors.

m <- glm(major ~ depth + time, data = quakes, family = binomial())
summary(m)
## 
## Call:
## glm(formula = major ~ depth + time, family = binomial(), data = quakes)
## 
## Coefficients:
##               Estimate Std. Error z value Pr(>|z|)    
## (Intercept) -3.665e+00  1.080e+00  -3.393 0.000692 ***
## depth        2.714e-03  4.469e-04   6.073 1.25e-09 ***
## time        -8.450e-10  7.116e-10  -1.187 0.235055    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 1978.6  on 19999  degrees of freedom
## Residual deviance: 1949.8  on 19997  degrees of freedom
## AIC: 1955.8
## 
## Number of Fisher Scoring iterations: 7

The coefficient for the effect of time on whether an earthquake is major or not is extremely small, as expected. Earthquakes are a (seemingly) random event (at least with respect to the data here), and should not be affected by things like time of day.

The coefficient for the effect of depth is small, but positive - assuming the model is accurate, earthquakes that occur deeper beneath the surface of the earth are slightly more likely to have a magnitude greater than 7.

c(0.0027140244520 - 1.96*0.0004468637253, 0.0027140244520 + 1.96*0.0004468637253)
## [1] 0.001838172 0.003589877
c(exp(0.0027140244520 - 1.96*0.0004468637253), exp(0.0027140244520), exp(0.0027140244520 + 1.96*0.0004468637253))
## [1] 1.001840 1.002718 1.003596

The 95% confidence interval for the coefficient of depth’s effect on major status is approximately (0.001838, 0.003590). This means that it can be assumed with roughly 95% certainty that a 1km increase in depth will result in an earthquake being between 0.1840% and 0.3596% more likely to be a major earthquake (again, assuming this model is accurate.)