ubrey Byrne
A
STA 112 Lab 2- Droughts
I ntroduction:
The data examined in this lab is derived from the Droughts data set provided in the [Link] file.
This dataset contains 294 observations, which are droughts from Denver, Colorado. In this particular lab,
statisticians focus on five variables, “soilm”, “apcp”, “tsoil”, “percFlow7day” and “percFlow14day” (all
of which will be explained below).
he first variable, “soilm”, measures soil moisture in kilograms per meter squared (kilograms of water per
T
square meter in the top layer of soil). As shown in the histogram below, this variable has a slight
right-skewed distribution. On average, soil moisture of 27.31 kg/m^2 (mean), with a median of 25.30
kg/m^2. However this variable is varied as the minimum soil moisture was 15.42 kg/m^2, and the
maximum was 44.48 kg/m^2.
he second variable, “apcp”, measures accumulated precipitation in kilograms per meter squared in the
T
previous week. As shown in the histogram below, this variable is substantially right-skewed. On average
precipitation accumulated in the previous week measures 135.75 kg/m^2 (mean), with a median of 86.32
kg/m^2. However, this variable is varied as the minimum precipitation accumulated was 0.00 kg/m^2, and
the maximum was 1681.46 kg/m^2.
he third variable, “tsoil”, measures the soil temperature in degrees Celcius. As shown in the histogram
T
below, this variable seems to be normally distributed. On average, soil temperature measures 4.103
degrees Celcius (mean), with a median of 4.830 degrees Celcius. However, this variable is varied as the
minimum temperature measured was -12.173 degrees Celcius, and the maximum temperature measured
was 20.672 degrees Celcius.
he fourth variable, “percFlow7day”, measures the percentage of maximum that local streams have been
T
flowing at for the previous 7 days before the drought. As shown in the histogram, this variable seems to
have a right skew. On average, local streams have a 46.301% maximum flow in the previous seven days,
with a median of 42.963%. However, this variable is varied as it has a minimum of 4.711% flow and a
maximum of 96.843% measured.
he final variable, “percFlow14day”, measures the percentage of maximum that local streams have been
T
flowing at for the previous 14 days before the drought. As shown in the histogram, this variable seems to
have a right skew. On average, local streams have a 46.481% maximum flow in the previous fourteen
days, with a median of 43.899%. However, this variable is varied as it has a minimum of 3.965% flow
and a maximum of 97.5% measured.
orrelation of Variables:
C
Upon examining the correlations of the variables in this data, several variables have notable correlations.
Firstly, the most prominent correlation is between the 7-day Percentage of Flow (percFlow7day) and the
14-day Percentage of Flow (percFlow14day). There is an almost perfect positive correlation between
these two variables (shown inPLOT AandPLOT B).Additionally, it is important to note that variables
tsoil and percFlow7day have a moderate positive correlation (Also shown inplots A and B). Lastly, a
significant correlation exists between variables APCP and percFlow7day, which also have a moderate
positive correlation (also evident inplots A andB) . There is also a noteworthy lack of a correlation
between APCP and tsoil.
he main question explored in the lab is “How importantis accumulated precipitation for explaining
T
soil moisture in Denver, Colorado?”. Statisticianswill use nested F-tests in addition to confidence
intervals and a hypothesis test to provide an answer to this question.
he Model:
T
Initially, statisticians think of creating a model to explain soil moisture with a simple regression model
using all explanatory variables (“apcp”, “tsoil”, “percFlow7day” and “percFlow14day”) and a response
variable of soilm, however, an issue arises with multicollinearity. This issue arises when creating a model,
when two variables are highly correlated, but not wholistically correlated. For variables, percFlow7day
and percFlow14day it was noted above that they have a high correlation. Upon doing calculations, it is
found that 97% of the variability in the 14-day Percentage of Flow (percFlow14day) can be explained by
the 7-day Percentage of Flow (percFlow7day) (As they have a correlation coefficient of .97). Therefore
this is an issue of multicollinearity, as the correlation is strong, but not perfect (perfect would be a
correlation coefficient of 1). Therefore, statisticians must leave out one of these two variables in the final
model to ensure accuracy and will choose to exclude percFlow14day from the model.
I n addition to this change in the model, it is also important to note that “tsoil” should be included in the
model as a polynomial. This is because the relationship between soil moisture and soil temperature is not
linear (seePLOT C). As shown in the plot, the pointson the scatter plot follow a curved pattern, which
means improvements must be made to the model to ensure accuracy. By making tsoil a polynomial term,
this nonlinear relationship can be captured more precisely than a linear model would allow.
ith these improvements in mind, statisticians can create a model in which soil moisture (“soilm”) is
W
explained by accumulated precipitation (“apcp”), the percentage of maximum that local streams have
been flowing at for the previous 7 days before the drought (“percFlow7day”), and the polynomial
variable, soil temperature (“tsoil”).
The unfit model that will be used to begin evaluation is as below:
Below is the fitted model that statisticians will base their further calculations on.
odel Diagnostics:
M
This model has a correlation coefficient (Adjusted R^2) of 0.7962. This value can be interpreted like so:
79.62% of the variability in soil moisture can be explained by accumulated precipitation (“apcp”), the
percentage of maximum that local streams have been flowing at for the previous 7 days before the
drought (“percFlow7day”), and the polynomial variable, soil temperature (“tsoil”). Because this value is
high, it can be concluded that this model is a good fit for the data, and will be useful in further
calculations.
dditionally, it is important to note that in this linear regression model, values that are above 3.5 standard
A
deviations from the mean, or below 3.5 standard deviations from the mean, are outliers. It is found that
the maximum residual is 9.8373, which, when standardized, is 2.837 standard deviations from the mean.
Therefore there are no outliers on the positive side. However, the minimum residual is -13.0596, which is
3.77 standard deviations away from the mean. Therefore this tells us that on the negative side, there is at
least one, possibly more, outliers.
efore fitting this model and progressing, statisticians must check theSix Assumptions of Linear
B
Regression. Specific plots can be found in theappendix,however a brief explanation is provided below.
1) Linearity: Linearity is satisfied by the residualplot (Plot D), as it does not have any patterns or
curves and is randomly scattered above and below zero.
2) Zero-Mean Errors: There are always zero mean errorsbecause in the model we choose to
minimize the sum of squared errors. Additionally, errors are seemingly centered at zero as they
are evenly above and below zero (SeePlot D).
3) Uniform Spread: Variance and spread do not changeas explanatory variables change. This is
exemplified byPlot D, as residuals do not followa specific pattern and are randomly scattered
above and below 0.
4) Independence: It cannot be implied by the datasetthat the errors are independent, however for the
sake of this lab we will assume that the sample is random and that there is no relation between the
different observations.
5) Random Sample: Likewise, it cannot be implied thatthe data set is derived from a random
sample, however for the sake of this lab, we will assume that it is.
6) Normality: This condition is violated as errors donot seem to be normally distributed (Shown by
Plot E). Despite this, we are still able to proceedwith calculations as there is a large sample size.
It is a typical rule of thumb in statistics that as sample size increases, normality does as well, so
we can ignore this violation for the following calculations.
ow that the assumptions of linear regression are checked, statisticians are able to create a 99%
N
confidence interval for accumulated precipitation to begin to answer the research question,How
important is accumulated precipitation for explaining soil moisture in Denver, Colorado?
fter computing a 99% confidence interval for this linear model, the interval has a 99% probability of
A
containing the true value of β1, recall this value represents the relationship between soil moisture and
accumulated precipitation.
he range of plausible values calculated for β1 is (.00068, .0075). This means that statisticians can
T
conclude that there must be a relationship between variables of soil moisture and accumulated
precipitation, verifying the claim that “apcp” is necessary for explaining “soilm”.
astly, statisticians will verify this claim by checking if accumulated precipitation is statistically
L
significant to the model. In statistics, statistical significance refers to the claim that a variable is
attributable to explaining the response variable (in this case soil moisture is the response variable). When
a variable is concluded to be statistically significant, it is indicated that the relationship between this
variable and the response variable is not by chance, but is instead mathematically proven.
e will be performing a hypothesis test to evaluate this claim. In doing so, we will test a null hypothesis
W
against an alternative hypothesis. The null hypothesis states: that there is no true relationship between soil
moisture and accumulated precipitation. The alternative hypothesis states that there is a relationship
between soil moisture and the accumulation of precipitation. To do so, statisticians will, in addition to
using the fitted model found above to represent the data and relationship between variables, compute a
t-statistic, which is a critical value from a t-distribution with a 289 degree of freedom. The evaluation for
this part will be in the form of a result from this hypothesis test, either verifying or rejecting the claim.
fter controlling for percFlow7day and the polynomial variable tsoil and carrying out a two-tailed t-test,
A
the t-statistic is found to be 3.1076. Recall that this is the critical value from the T distribution with a
degree of freedom of 289. The probability that this T value is a random draw from T~T1408 (p-value) is
.0021. This means that it is very unlikely that this T value is randomly drawn, and therefore statisticians
can reject the null hypothesis. Because the null hypothesis is rejected, the alternative hypothesis is
accepted. Therefore it can be concluded that there is a statistically significant relationship between soil
moisture and accumulated precipitation.
his conclusion further verifies the claim that accumulated precipitation is necessary in explaining soil
T
moisture in Denver, Colorado.
astly, statisticians must test the practical significance of this result:
L
Note that statistical significance shows the effect within a study, while practical significance explains
whether or not the effect is large enough to be meaningful in the real world.
o do so, we calculated the predicted impact of moving from the first quantile to the third quantile of
T
accumulated precipitation on soil moisture. This impact was rounded to around .6388, which explains that
an increase in precipitation from the first quantile to the third quantile is associated with an increase in
soil moisture. Additionally, due to .6388 being relatively large in comparison to other numbers displayed
in our model, it can be concluded that accumulated precipitation has a large practical effect given the
scale of soil moisture.
Appendix:
PLOT A:
PLOT B:
PLOT C:
PLOT D:
PLOT E: