MariaLiza F224RegressionandCorrelation
MariaLiza F224RegressionandCorrelation
MariaLiza F224RegressionandCorrelation
Assignment
http://sphweb.bumc.bu.edu/otlt/MPH-Modules/BS/BS704_Correlation-Regression/BS704_Correlation-Regression_print.html
1. Correlation example with two variables
We wish to estimate the association between gestational age and infant
birth weight. In this example, birth weight is the dependent variable and gestational
age is the independent variable. Thus y=birth weight and x=gestational age. The
data are displayed in a scatter diagram in the figure below.
http://sphweb.bumc.bu.edu/otlt/MPH-Modules/BS/BS704_Correlation-Regression/BS704_Correlation-Regression_print.html
1. Correlation example with two variables
Computing the Correlation Coefficient
s2x and s2y are the sample variances of x and y, defined as follows:
http://sphweb.bumc.bu.edu/otlt/MPH-Modules/BS/BS704_Correlation-Regression/BS704_Correlation-Regression_print.html
1. Correlation example with two variables
Computing the Correlation Coefficient
http://sphweb.bumc.bu.edu/otlt/MPH-Modules/BS/BS704_Correlation-Regression/BS704_Correlation-Regression_print.html
1. Correlation example with two variables
Computing the Correlation Coefficient
To compute the variance of gestational age, we need to sum the squared
deviations (or differences) between each observed gestational age and the
mean gestational age. The computations are summarized below.
http://sphweb.bumc.bu.edu/otlt/MPH-Modules/BS/BS704_Correlation-Regression/BS704_Correlation-Regression_print.html
1. Correlation example with two variables
Computing the Correlation Coefficient
http://sphweb.bumc.bu.edu/otlt/MPH-Modules/BS/BS704_Correlation-Regression/BS704_Correlation-Regression_print.html
1. Correlation example with two variables
Computing the Correlation Coefficient
The variance of birth weight is computed just as we did for gestational age
as shown in the table below.
http://sphweb.bumc.bu.edu/otlt/MPH-Modules/BS/BS704_Correlation-Regression/BS704_Correlation-Regression_print.html
1. Correlation example with two variables
Computing the Correlation Coefficient
http://sphweb.bumc.bu.edu/otlt/MPH-Modules/BS/BS704_Correlation-Regression/BS704_Correlation-Regression_print.html
1. Correlation example with two variables
Computing the Correlation Coefficient
The computations are summarized below. Notice that we simply copy the
deviations from the mean gestational age and birth weight from the two
tables above into the table below and multiply.
http://sphweb.bumc.bu.edu/otlt/MPH-Modules/BS/BS704_Correlation-Regression/BS704_Correlation-Regression_print.html
1. Correlation example with two variables
Computing the Correlation Coefficient
http://sphweb.bumc.bu.edu/otlt/MPH-Modules/BS/BS704_Correlation-Regression/BS704_Correlation-Regression_print.html
1. Correlation example with two variables using SPSS
1. Correlation example with two variables using SPSS
1. Correlation example with two variables using SPSS
1. Correlation example with two variables using SPSS
Suppose that we are given the number of class periods missed by the 12
students taking the chemistry course. The data are recorded in the table below.
Compute and interpret the coefficient of multiple determination for the sample
above.
Solution:
we find
Solution:
and hence
Table above shows that the chemistry grade of the students has a significant
relationship with their test scores. However, classes missed by the students do
not affect their test scores and chemistry grades.
3. Simple linear regression example
Problem:
A college bookstore must order books two months before each semester
starts. They believe that the number of books that will ultimately be sold for any
particular course is related to the number of students registered for the course
when the books are ordered. They would like to develop a linear regression
equation to help plan how many books to order. From past records, the
bookstore obtains the number of students registered, X, and the number of
books actually sold for a course, Y, for 12 different semesters. These data are
below.
https://www.nku.edu/~statistics/Simple_Linear_Regression.htm
3. Simple linear regression example
Problem:
A. Obtain a scatter plot of the number of books sold versus the number of registered
students.
B. At a .01 level of significance is there sufficient evidence to conclude that the number of
books sold is related to the number of registered students in a straight-line manner?
E. Give the regression equation, and interpret the coefficients in terms of this problem.
F. If appropriate, predict the number of books that would be sold in a semester when 30
students have registered. Use 95% confidence.
G. If appropriate, estimate the average number of books that would be sold in a semester
for all courses with 30 students registered. Use 95% confidence.
H. If appropriate, predict the number of books that would be sold in a semester when 5
students have registered. Use 95% confidence.
https://www.nku.edu/~statistics/Simple_Linear_Regression.htm
3. Simple linear regression example
Solutions:
As the number of students registered for the course increases, the number of
books sold by the bookstore appears to increase in a straight-line manner.
https://www.nku.edu/~statistics/Simple_Linear_Regression.htm
3. Simple linear regression example
Solutions:
B. Ho: The number of students registered and the number of books sold are not
correlated
Ha: The number of students registered and the number of books sold are
correlated
Interpretation:
At the .01 level of significance I conclude that as the number of
students registered increases, the number of books sold
increases in a straight-line manner.
https://www.nku.edu/~statistics/Simple_Linear_Regression.htm
3. Simple linear regression example
Solutions:
Since the p-value is less than 0.0001, this indicates that if the number of
students registered and the number of books sold are not correlated (if the null
hypothesis is true), then there is virtually no chance that the observed points in
the scatterplot would exhibit such an obvious straight-line pattern.
r 2 = .809 (80.9%).
https://www.nku.edu/~statistics/Simple_Linear_Regression.htm
3. Simple linear regression example
Solutions:
When no students have registered for a course, the number of books sold is 9.30
(or about 9).
It is not particularly meaningful in this problem since all the classes sampled had
more than 25 students registered.
For each additional student registered for a course, the number of books sold
increases by 0.673.
https://www.nku.edu/~statistics/Simple_Linear_Regression.htm
3. Simple linear regression example
Solutions:
I am 95% confident that for a course that has 30 students registered the bookstore
will sell between 25.9 and 33.1 books.
https://www.nku.edu/~statistics/Simple_Linear_Regression.htm
3. Simple linear regression example
Solutions:
I am 95% confident that for all courses that have 30 students registered the
bookstore will sell an average of between 28.3 and 30.7 books per semester.
https://www.nku.edu/~statistics/Simple_Linear_Regression.htm
3. Simple linear regression example
Solutions:
Since 5 students is not within the range of the sampled number of students, it is not
appropriate to use the regression equation to make this prediction.
We do not know if the straight-line model would fit data at this point, and we should
not extrapolate.
https://www.nku.edu/~statistics/Simple_Linear_Regression.htm
3. Simple linear regression example
Solutions:
https://www.nku.edu/~statistics/Simple_Linear_Regression.htm
3. Simple linear regression example using SPSS
3. Simple linear regression example using SPSS
3. Simple linear regression example using SPSS
3. Simple linear regression example using SPSS
3. Simple linear regression example using SPSS
Used to predict
3. Simple linear regression example using SPSS
y = 9.300 + 0.673x
3. Simple linear regression example using SPSS
3. Simple linear regression example using SPSS
4. Multiple linear regression example
Suppose that we are given the number of class periods missed by the 12
students taking the chemistry course. The data are recorded in the table below.