Data Analysis

Module 4 Pair Quiz

Angelica Masa and Ma. Angelika Regoso

2021-07-29

Question #1

An article in the Journal of Sound and Vibration [“Measurement of Noise-Evoked Blood Pressure by Means of Averaging Method: Relation between Blood Pressure Rise and PSL” (1991, Vol. 151(3), pp. 383-394)] described a study investigating the relationship between noise exposure and hypertension. The following data are representative of those reported in the article.

##    y   x
## 1  1  60
## 2  0  63
## 3  1  65
## 4  2  70
## 5  5  70
## 6  1  70
## 7  4  80
## 8  6  90
## 9  2  80
## 10 3  80
## 11 5  85
## 12 4  89
## 13 6  90
## 14 8  90
## 15 4  90
## 16 5  90
## 17 7  94
## 18 9 100
## 19 7 100
## 20 6 100

A. Draw a scatter diagram of y (blood pressure rise in millimeters of mercury) versus x (sound pressure level in decibels). Does a simple linear regression model seem reasonable in this situation?

scatter.smooth(x=data$x, y=data$y, main="Blood Pressure Rise vs. Sound Pressure Level", xlab = "Sound Pressure Level (dB)", ylab = "Blood Pressure Rise (mm Hg)" )

Figure 1.1. Scatter diagram of y (blood pressure rise in millimeters of mercury) versus x (sound pressure level in decibels).

Figure 1.1. Scatter diagram of y (blood pressure rise in millimeters of mercury) versus x (sound pressure level in decibels).

Yes, a simple linear regression model seems reasonable in this situation.

B. Fit the simple linear regression model using least squares. Find an estimate of σ2.

Using Least Squares Method:

First, calculate Sxy, Sxx, and Syy.

x=data$x; y=data$y
Sxy = sum((x - mean(x)) * (y - mean(y)))
Sxx = sum((x - mean(x)) ^ 2)
Syy = sum((y - mean(y)) ^ 2)
c(Sxy, Sxx, Syy)
## [1]  533.2 3059.2  124.2

Sxy = 533.2

Sxx = 3059.2

Syy = 124.2

Then, calculate \(\hat{\beta}_0\) and \(\hat{\beta}_1\).

beta_1_hat = Sxy / Sxx
beta_0_hat = mean(y) - beta_1_hat * mean(x)
c(beta_0_hat, beta_1_hat)
## [1] -10.1315377   0.1742939

\(\hat{\beta}_0\) = -10.1315377

\(\hat{\beta}_1\) = 0.1742939

The least squares estimates of the intercept and slope are \(\hat{\beta}_0\) = -10.1315377 and \(\hat{\beta}_1\) = 0.1742939.

Thus, the fitted simple linear regression model is \(\hat{y}\) = -10.1315377 + 0.1742939x.

Variance Estimation:

y_hat = beta_0_hat + beta_1_hat * x
e     = y - y_hat
n     = length(e)
σ_2_hat  = sum(e^2) / (n - 2)
σ_2_hat
## [1] 1.737026

The estimated σ2, \(\hat{\sigma}^2\) = 1.737026.

To check: Using the lm Function

linear.regression <- lm(y ~ x, data=data)
summary(linear.regression)
## 
## Call:
## lm(formula = y ~ x, data = data)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -1.8120 -0.9040 -0.1333  0.5023  2.9310 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept) -10.13154    1.99490  -5.079 7.83e-05 ***
## x             0.17429    0.02383   7.314 8.57e-07 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.318 on 18 degrees of freedom
## Multiple R-squared:  0.7483, Adjusted R-squared:  0.7343 
## F-statistic:  53.5 on 1 and 18 DF,  p-value: 8.567e-07

Indeed, the simple linear regression model is \(\hat{y}\) = -10.13154 + 0.17429x (rounded off to 5 dec. places), while the estimated σ2 can be calculated by squaring the value of the residual standard error/residual standard deviation, which is 1.3182 = 1.737 (rounded off to 3 dec. places).

C. Find the predicted mean rise in blood pressure level associated with a sound pressure level of 85 decibels.

To predict the mean rise in blood pressure level associated with a sound pressure level of 85 decibels, use the fitted simple linear regression model: \(\hat{y}\) = -10.1315377 + 0.1742939x.

y_hat <- beta_0_hat + beta_1_hat * 85
y_hat
## [1] 4.683447

Thus, the estimated mean rise in blood pressure level associated with a sound pressure level of 85 decibels is 4.683447 mm Hg.