===============================================================================================================
##
## Call:
## lm(formula = Useful_Range ~ Contrast + Brightness, data = QUES2)
##
## Residuals:
## Min 1Q Median 3Q Max
## -32.334 -20.090 -8.451 8.413 69.047
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 238.5569 45.2285 5.274 0.00188 **
## Contrast -2.7167 0.6887 -3.945 0.00759 **
## Brightness 0.3339 0.6763 0.494 0.63904
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 36.35 on 6 degrees of freedom
## Multiple R-squared: 0.7557, Adjusted R-squared: 0.6742
## F-statistic: 9.278 on 2 and 6 DF, p-value: 0.01459
Using the values of estimated coefficients found in the lm function, we can get the regression model: \[ Useful ~Range~=~\beta_0~+~\beta_1X_1~+~\beta_2X_2 \] where \(\beta_0\) = 238.5569, \(\beta_1\) = -2.7167, \(\beta_2\) = 0.3339
Substituting the values, our fitted regression model is: \[ Useful ~Range~=~238.5569~-~2.7167X_1~+~0.3339X_2 \]
\(\sigma^2\) is found at \[ \sigma^2 ~=~\frac{SS_E}{n-p} \] \(SS_E\) can be obtained using the function:
SSE <- sum((fitted(multipleregression)-Useful_Range)^2)
SSE
## [1] 7927.636
Substituting the value obtained for \(SS_E\) and the value n = 9 and p = k + 1 = 2 + 1 = 3 We get
\[ \sigma^2~=~\frac{7927.636}{6}~=~1321.273 \]
Hence, the estimated \(\sigma^2\) is 1321.273.
Looking at the function above, we take the values of the the standard errors of the regression coefficients:
\(\hat{\beta_1}\) = Contrast = 0.6887
\(\hat{\beta_2}\) = Brightness = 0.6763
We let:
\(X_1\) = Contrast = 75 and \(X_2\) = Brightness = 80
and substituting them to the regression model \[ \hat{y}~=~238.5569 ~-~2.7167X_1 ~+~ 0.3339X_2 \] We get: \[ \hat{y}~=~238.5569 ~-~2.7167(75) ~+~ 0.3339(80)~=~61.5164 \] The useful range is predicted to be 61.5164
Null Hypothesis: \(H_0\):\(\beta_1\) = \(\beta_2\) = 0
Alternative Hypothesis: \(H_1\):\(\beta_1\) \(\ne\) \(\beta_2\)
Test Statistic: \[ f_0~=~\frac{SS_R/k}{SS_E/(n-p)} \] Reject \(H_0\) if P-value > 0.05
Computations: We can obtain \(SS_R\) using the function
## [1] 24518.36
So our values are:
\(SS_E\) = 7927.636, k = 2, \(SS_R\) = 24518.36, n - p = 6
\[ f_0~=~\frac{24518.36/2}{7927.636/6} ~=~9.2783 \] To get the p-value
x = 9.2783
v1 = 2
v2 = 6
pf(x, df = v1, df2 = v2, lower.tail = FALSE)
## [1] 0.01458643
\[ P(9.2783) > ~0.05~=~ 0.01458643~>~0.05 \]
Hence, the p-value of the test is 0.01458643 and we can reject \(H_0\).
Null Hypothesis: \(H_0\):\(\beta_j\) = 0 Alternative Hypothesis: \(H_0\):\(\beta_j\) \(\ne\) 0 Test Statistic: \[ t_0~=~\frac{\hat{\beta_j}}{se(\beta_j)} \] Reject \(H_0\) if: \(|t_0|\) > \(t_{a/2,n-p}\)
Computations:
t-test for Contrast \(\beta_1\):
\[ t_0~=~\frac{\hat{\beta_1}}{se(\hat{\beta_1})} \]
when \(\hat{\beta_1}\) = -2.7167 and se(\(\hat{\beta_1}\)) = 0.6887
we get: \[ t_0~=~\frac{-2.7167}{0.6887} = -3.9447 \] With \(\alpha\) = 0.05, \(\alpha/2\) = 0.025 and n - p = 6 we get:
\[ |t_0|~>~t_{\alpha/2,n-p}~=~3.9447~>~t_{0.025,6}~=~2.447 \] so we reject \(H_0\) for this coefficient
t-test for Brightness \(\beta_2\): \[ t_0~=~\frac{\hat{\beta_2}}{se(\hat{\beta_2})} \] when \(\beta_2\) = 0.3339 and se(\(\hat{\beta_2}\)) = 0.6763
we get: \[ t_0~=~\frac{0.3339}{0.6763}~=~0.4937 \]
With \(\alpha\) = 0.05, \(\alpha/2\) = 0.025 and n - p = 6 we get: \[ |t_0|~>~t_{\alpha/2,n-p}~=~0.4937~>~t_{0.025,6}~=~2.447 \] with this, we fail to reject \(H_0\)
What do these test mean?
As we reject \(H_0\) for the Contrast \(\hat{\beta_1}\), we can conclude that it is a good predictor of the regression model while as we fail to reject \(H_0\) for the Brightness \(\hat{\beta_2}\), we can conclude that it is not a good predictor of the regression model.