For safety reasons, a leading manufacturer of SCUBA tanks needed to determine how tank pressure changed with increasing temperature. 27 tanks were filled to approximately 200 bar (atmospheres) at 0\(^o\)C. Tanks were then set at temperatures between 0\(^o\)C and 40\(^o\)C, and the pressure was measured.
The data is in the file Pressure.csv, which contains the variables:
| Variable | Description |
|---|---|
| TempC | Tank temperature (degrees Celsius) |
| Pressure | Tank pressure (bar) |
For safety reasons, we are interested in quantifying the relationship between the air pressure inside a SCUBA tank and its temperature. In particular, how the air pressure changes due to an increase in temperature.
Air.df = read.csv("Pressure.csv",header=TRUE)
plot(Pressure~TempC, data=Air.df, xlab = "SCUBA Tank Temperature (degrees Celcius)", ylab = "Tank Pressure (bar)")
Air.lm=lm(Pressure~TempC, data=Air.df)
modelcheck(Air.lm)
summary(Air.lm)
##
## Call:
## lm(formula = Pressure ~ TempC, data = Air.df)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.99037 -0.81926 0.07852 0.63630 2.65185
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 200.27926 0.39097 512.26 <2e-16 ***
## TempC 0.72844 0.01642 44.35 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1.102 on 25 degrees of freedom
## Multiple R-squared: 0.9875, Adjusted R-squared: 0.9869
## F-statistic: 1967 on 1 and 25 DF, p-value: < 2.2e-16
confint(Air.lm)
## 2.5 % 97.5 %
## (Intercept) 199.4740441 201.0844744
## TempC 0.6946186 0.7622702
plot(Pressure~TempC, data=Air.df, xlab = "SCUBA Tank Temperature (degrees Celcius)", ylab = "Tank Pressure (bar)")
abline(Air.lm)
The scatter plot suggested a linear relationship between the tank pressure and temperature, and with reasonably constant scatter, so a simple linear regression model was fitted. The Residuals vs Fitted model has a linear trend which would be acceptable despite the slight curves it consists of. The QQ-residuals has points at an acceptable distance on the line showing little variation. Although the Histogram of residuals has a large from at the right side, it still supports the bell curve. Cooks distance model does not contain any values that exceed 0.4 meaning that by this model, the assumption is satisfied.
Model assumptions were all satisfied and the effect of temperature was highly significant.
Our model is:
{Pressure = β0 + β1 x temp + \(\epsilon_i\)} where \(\epsilon_i \sim iid ~ N(0,\sigma^2)\)
Our fitted model explains {98.69}% of the variability in the data.
preds = data.frame(TempC=c(0,5))
predict (Air.lm, preds, interval="prediction")
## fit lwr upr
## 1 200.2793 197.8715 202.6870
## 2 203.9215 201.5557 206.2873
There is very strong evidence (p<0.0001) that there is a strong positive linear relationship between pressure and temperature which means that we can reject the null hypothesis which claims that there is no relationship between the air pressure inside a scuba tank and its temperature. We predict that a SCUBA tank with a 5 degree increase of the temperature can result the air pressure being between 201.56 and 206.29, increasing by ~3.64}
1.3 Comment on the plots
{The plots on the graph shows a clear positive linear trend with each 5th increment degree increasing by approxamately the same pressure. These two variables may be associted as the variation also seems to be constant.}