Overview of Data

head(df)
##           Designation Discovery.Date.YYYY.MM.DD H..mag. MOID..AU. q..AU. Q..AU.
## 1  419880 (2011 AH37)                01/07/2011    19.7     0.035   0.84   4.26
## 2  419624 (2010 SO16)                09/17/2010    20.5     0.028   0.93   1.08
## 3 414772 (2010 OC103)                07/28/2010    19.0     0.333   0.39   2.00
## 4  414746 (2010 EH20)                03/06/2010    18.0     0.268   1.25   3.99
## 5 407324 (2010 OB101)                07/18/2010    20.7     0.111   0.77   2.46
## 6  398188 (2010 LE15)                06/03/2010    19.5     0.024   0.63   1.10
##   period..yr. i..deg. PHA Orbit.Class
## 1        4.06    9.65   Y      Apollo
## 2        1.00   14.52   Y      Apollo
## 3        1.31   23.11   N      Apollo
## 4        4.24   23.89   N        Amor
## 5        2.06    9.12   N      Apollo
## 6        0.80   13.25   Y        Aten

Linear Regression Model (Plotly)

Target for this linear regression was aphelion (Q..AU.), and the predictor is perihelion (q..AU.)

Residuals of Linear Regression Models #1 (ggplot)

Residuals of Linear Regression Models #2 (ggplot)

Residuals of Linear Regression Models #3 (ggplot)

Statistics

Apollo Fitted Line:
\(\text{Y-intercept} = 4.4944\)
\(\text{Slope} = -1.6430\)
\(\text{p-value} = 0.0144\)
\(\text{Residual standard error} = 1.386 \text{ on 103 degrees of freedom}\)
\(\text{Multiple }R^2 = 0.0568\)
\(\text{Adjusted } R^2 = 0.0476\)

Amor Fitted Line:
\(\text{Y-intercept} = -13.809\)
\(\text{Slope} = 15.989\)
\(\text{p-value} = 0.0629\)
\(\text{Residual standard error} = 4.9 \text{ on 59 degrees of freedom}\)
\(\text{Multiple }R^2 = 0.0574\)
\(\text{Adjusted } R^2 = 0.0414\)

Statistics

Aten Fitted Line:
\(\text{Y-intercept} = 1.7814\)
\(\text{Slope} = -0.8847\)
\(\text{p-value} = 0.00085\)
\(\text{Residual standard error} = 0.127 \text{ on 13 degrees of freedom}\)
\(\text{Multiple }R^2 = 0.5882\)
\(\text{Adjusted } R^2 = 0.5566\)

R code for Linear Regression Models

# Plots three scatter plots based on the orbit class of the object
fig1 <- plot_ly(x = x1,
        y = y1,
        type = "scatter", mode = "markers",
        name = unique(df$Orbit.Class)[1],
        width = 800, height = 430) %>%
  add_lines(x = x1, y = fitted(mod1), name = "Apollo Fitted") %>%
  add_markers(x = x2, y = y2, name = unique(df$Orbit.Class)[2]) %>%
  add_lines(x = x2, y = fitted(mod2), name = "Amor Fitted") %>%
  add_markers(x = x3, y = y3, name = unique(df$Orbit.Class)[3]) %>%
  add_lines(x = x3, y = fitted(mod3), name = "Aten Fitted")