Lab 1 1
Lab 1 1
Lab 1 1
Question 1: Parameter(s)
Define the population parameter(s) of interest associated with the research objective. Only define parameter(s)
that are specifically associated with the research objective. Include both the definition in the context of the
problem as well as the symbol you will use to represent the parameter(s). Hint: look at your Model in Q3 and
your Hypotheses in Q4.
The parameter of interest is the slope (B[1]) of the relationship between IA and FL, or the
average change in IA given a one unit increase in FL.
Question 2: Variables
List all variables which you will record on each unit of observation (subject) in the sample. You should clearly
identify the role of each variable listed (e.g., response, predictor, factor, block, or extraneous variable…note, not
all types of variables may be present in your question). Be sure to specify the units of measurement, when
applicable.
FL: Distance from start point of longest distance of actual to intended tear (in mm)
(predictor) IA: Longest distance of actual to intended tear (in mm) (response) Tester: the
specific individual who ripped the paper. Tester one generated datapoints 1-10, tester two
generated datapoints 11-20, and tester 3 generated datapoints 21-30 (Extraneous variable)
Question 3: Model
State an appropriate model for the data generating process.
FL: (flat to longest)= Distance from start point to the point with the largest distance
between the actual and intended tear (in mm) (predictor) IA: (intended to actual)= Longest
distance of actual to intended tear (in mm) (response)
(intended to actual)[i]= B[0] + B[1] x (flat to longest)[i] + E[i]
Where B[0] is the intercept, so the intended to actual distance when the flat to longest
distance=0 (in this context it will almost certainly be an extrapolation). B[1] is the slope, so,
for every one unit change of the flat to longest distance, the intended to actual distance will
change by B[1] units. E is the error or noise in the measurement for the ith value.
Question 4: Hypothesis
If appropriate, state the hypotheses associated with the research objective using the parameters you defined
above. If the research objective does not involve testing hypotheses, clearly identify the parameter you will
estimate and with what level of confidence this parameter will be estimated.
H[0]: (intended to actual)[i]= B[0] + E[i] H[1]: (intended to actual)[i]= B[0] + B[1] x (flat to
longest)[i] + E[i]
H0 states that there knowing the flat to longest distance will not help you to better predict
the intended to actual distance, in other words, that the flat to longest is not associated
with the intended to actual in a linear fashion and so does not belong in the model, or
B[1]=0. H1 says that you can better predict the intended to actual distance if you know the
flat to longest distance.
Each tester tore 10 sheets of paper, and recorded the IA and FL for the half of the paper
torn with the longest IA length, for a combined total of 30 observations. Data was collected
using 3 testers, each using the standard printer paper located in their house. We used
standard 8.5“x11” (216mm x 280mm) printer paper. We started by lightly marking the
intended tear line down the middle of the paper with a pencil so that the tear would be
nominally parallel to the 216mm side of the paper. Each tester then tore down the middle,
attempting to separate the paper into two 210x148.5mm sections following the line drawn
earlier. The paper was not scored or folded prior to tearing. We used 3 testers, with each
tester ripping the paper in whatever way felt most natural to them while sitting. This was
to ensure that the style of tearing used for the sample would be as representative of the
true population of all tears made in a4 paper as possible. We also did not control for the
brand of printer paper used, further randomizing the sample. The data was imputed into R
studio in the order it was collected for each tester, so that the first 10 data points are from
the first tester, data points 11-20 are from the second tester and so on.
Each person is tearing the paper using a different style of grip (we did not control for finger
placement on the paper or the distance the paper was held from the body or the speed the
tear was performed) and using a different brand of paper. Though the variations in testers’
tear method and paper brand allows the sample to be more representative of the wider
population of interest’s diverse tearing conditions, it is also a source of variability, and with
the small sample size, that variation is quite pronounced and likely contributes to a large
part of the variability in the response variable, as knowing the tester gives you information
that allows you to better predict IA given FL.
A limitation of the study is that it only tested rips performed while testers were sitting. In
the real world, paper is torn in a variety of positions: while sitting, standing, crouched over,
while the paper is held outstretched or close to the body etc.and these different locations
and positions will change the muscle groups used and the force each person can apply due
to how they how they hold the paper. In the future, testing more positions would help make
the sample more representative of the wider population.
Question 7: Graphic
Construct and describe a graphical summary of the data collected.
qplot(data = tear,
y = IA,
x = FL,
geom = "point") +
labs(y = "IA (in MM)",
x = "FL (in MM)")
The majority of the data is centered between 150 and 216 mm from the initial tear point of
the paper and IA ranges from 0 to 175mm. There does not appear to be a linear
relationship between FL and IA. There are 3 outliers with smaller then typical FL values of
25, 38, and 63mm.
Question 8: Conditions
State any conditions/assumptions of the statistical inference technique you are planning to use. Also, discuss
how reasonable you feel each is. If any plots are generated to do this, they should be included here.
tear.model = specify_mean_model(IA ~ 1 + FL, data = tear)
tear.diag = obtain_diagnostics(tear.model, data = tear)
qplot(data = tear.diag,
sample = .resid,
geom = "qq") +
labs(x = "Theoretical Quantiles",
y = "Sample Quantiles")
qplot(data = tear.diag,
y = .resid,
x = .fitted,
geom = "point") +
labs(y = "residuals",
x = "predicted values")
qplot(data = tear.diag,
y = .resid,
x = seq_along(.resid),
geom = c("line", "point")) +
labs(y = "Residuals",
x = "Order of Observations")
1- The error in the
response has a mean of 0 for all values of the predictor. -To evaluate this we look at a plot
of the residuals vs the predicted values. If the mean at all points in the line is 0, then the
model has been correctly specified and we can reasonably assume the this condition is met.
In this graph, the mean is zero except for the portion of data with predicted values between
40mm and 50mm, so it is not reasonable to conclude that the model has been been
correctly specified, and assuming this condition is met would also be unreasonable. We can
also see the 3 outliers with predicted values around 20-25mm, which are not part of any
trend.
2- The error in the response for one subject is independent of the error in response for any
other subject -This condition requires us to only gather data from one half of the torn
paper, instead of collecting 2 data points per tear. That way, any given tear only impacts
one data point. We can look at the plot of the residuals in the order they were collected to
see if there is a trend which suggests a departure from independence of the errors. As the
data is ordered with each tester generating 10 consecutive data points, we can see 3
distinct sections each with their own level of variability, and one section/testers data
(observations 7-17) has a clear upwards trend. This suggests that the tester selection
impacted the variability, and thus we cannot assume the conditions for independence have
been met.
3- The errors are identically distributed for all values of the predictor. -The errors are not
identically distributed. Looking at the graph of residuals and predicted values there is less
variability for smaller predicted values then larger ones. As the spread varies based on the
value of the predictor, it is not reasonable to assume that this condition has been met. The
three outliers mentioned earlier do skew the data, as the extend the range of predicted
values by 2x, which makes the trend harder to see. It is clear that the spread between
predicted values of 40-50 is different from the spread between predicted values of 50-60.
4- The errors follow a normal distribution. -If this condition was met we would see a
straight line on the probability plot, however we instead see a clear bowing of the data,
indicating that it is not reasonable to assume that the error in this data follows a normal
distribution.
Question 9: Analysis
Provide all relevant computer output here from the statistical analysis you used to address the research
objective (e.g. p-values, confidence intervals, model fits, et. cetera). If your analysis requires any
conditions/assumptions that you found unreasonable, please be sure to describe those here.
tear = tibble(
`FL` = c(157, 216, 148, 216, 216, 187, 210, 142, 173, 216, 154,
163,161,197,167,173,195,183,200,185, 216, 216, 216, 203, 38, 203, 25, 216,
216,
63),
`IA` = c(23, 30, 5, 110, 137, 24, 5, 15, 63, 25,
46,71,42,92,57,75,54,132,38,120, 70, 64, 13, 13, 19, 10, 13, 19, 44, 32)
)
tear.model.h1 = specify_mean_model(IA ~ 1 + FL, data = tear)
tear.model.h0 = specify_mean_model(IA ~ 1, data = tear)
compare_models(tear.model.h1,
tear.model.h0,
assume.identically.distributed = FALSE,
assume.normality = FALSE)
estimate_parameters(tear.model.h1,
confidence.level = 0.95,
assume.identically.distributed = FALSE,
assume.normality = FALSE)
summarize_model_fit(tear.model.h1)
# A tibble: 1 x 8
r.squared sigma logLik AIC BIC deviance df.residual nobs
<dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <int> <int>
1 0.0701 37.5 -150. 307. 311. 39354. 28 30
In order to do the analysis, we needed to assume that the error in the response has a mean
of zero for all values of the predictor, and that the error in the response for one subject is
independent of the error in response for all other subjects. In the response to question 8,
we described why it would be unreasonable to assume that these conditions have been
met, but we will assume they have been met anyway as they are necessary if we are to do
any sort of analysis.