In: Statistics and Probability
Use SAS to answer the question:
Researchers have studied bears by anesthetizing them in order to
obtain vital measurements, such as
age, gender, length, and weight. Because most bears are quite heavy
and difficult to lift, researchers and
hunters experience considerable difficulty actually weighting a
bear in the wild. Data in the following
table represent the body length and weight of eight male bears.
x, length (in.) 53.0 67.5 72.0 72.0 78.5 68.5 73.0 37.0
y, weight (lb.) 80 344 426 348 262 360 332 34
(a) What is the sample correlation coefficient between length
and weight for these eight bears? And
test if their correlation is 0.
(b) Based on these data, does there appear to be a linear
relationship between the length of a bear
and its weight? Test ?=0.01.
(c) According to your simple linear regression model, what is the
estimated weight of a bear 75
inches long?
Given data set:
x | y |
53 | 80 |
67.5 | 344 |
72 | 426 |
72 | 348 |
78.5 | 262 |
68.5 | 360 |
73 | 332 |
37 | 34 |
Based on above data, some measures which are calculated.
Mean x, = 65.18
Mean y, = 273.25
Standard deviation x, x = 13.57
Standard deviation y, y = 141.227
a) Formula for correlation(pearson) coefficient is:
We know all the values, Putting values in above formula we get,
r = 0.85
To compute same thing in SAS,
Let's say that above data is stored in data set bear_data
Column names: len, wgt
To get correlation, execute the below command:
proc corr data = bear_data ; VAR len wgt ; run;
This will give us the correlation table as output.
From above calculation it's clear that correlation is not 0
b.) To see if their is linear relationship or not we need to draw scatter plot of above data
As it is clear from above scatter plot , In almost all cases as the length increases weight also increases.
So, it is possible to draw the relationship as in the form of line. Hence we can compute linear relationship between length and weight.
To get above scatter plot in SAS:
PROC sgscatter DATA=bear_data; PLOT wgt*len title 'len vs wt of bear'; RUN;
Linear Model:
The eqn will be in the following form:
y = a + b*x
where a = intercept
b = slope
Now, slope is given as:
b = r * (y / x)
b = 0.85 * 10.401
b = 8.841
For intercept the formula is:
a = - b *
a = 273.25 - 65.18 * 8.841
a = -303.006
So, equation becomes:
y = -303.006 + 8.841 * x
To get this equation in SAS:
proc reg data=bear_data; model wgt = len /alpha = 0.01; run;
This will produce the output in tabular form with all requierd statistics of Linear regression along with confidence interval of 99% since we have set the alpha manually.
c.) With our model, if len(x) = 75 then weight is,
y = -303.006 + 8.841 * 75
y = 360.069
This is the weight if length is 75 inches.