GEOG306 Spring 2023 Homework_7
docx
keyboard_arrow_up
School
Anne Arundel Community College *
*We aren’t endorsed by this school
Course
240
Subject
Geography
Date
Feb 20, 2024
Type
docx
Pages
4
Uploaded by AdmiralHerringMaster1048
GEOG 306 Spring 2023 Homework 7: Regression Analysis Instructor: Dr. Naijun Zhou
Important Instructions
Due: 9AM, Wed., May 3, 2023 on ELMS
.
You can write your answers in this Word document, and submit this Word document with
your answers on ELMS.
For questions that ask you to do a calculation by
hand
, you need to show the steps of the calculation
. You may use a calculator but you cannot
use the calculator’s statistical functions and you cannot use R
. If you do not show your calculations, you will not receive any points.
For questions that ask you to do a calculation in R, you need to show your final answer
AND the R code that you used to answer the question
. Submit ‘clean’ code that is ready to run right away (no results or error messages). If you do not show the R code
that you used, you will not receive any points
.
Although you won’t get bonus points, it’s highly recommended to type all the formula with a tool
(e.g., the Equation in Word). See the lecture slides for examples of typed formula, such as X
=
∑
i
=
1
n
x
i
n
.
One of the key tasks in metropolitan area transportation planning is to
estimate the total number of trips made by households during a typical day.
It is hypothesized that one of the most important determinants of household
trips is household income. 12 households are randomly selected to collect
their trips per day and household income, and the data are provided in the
following table. Trips per day
Household Income ($1,000)
3
25
5
36
5
33
4
27
6
42
7
48
9
63
7
54
8
66
8
72
6
51
5
45
Question 1.
(1 point). Use software R
to plot a scatter gram of trips and household income. Attach the scatter gram to this question. Do you think a linear regression will explain the relationship between the two variables? -1-
GEOG 306 Spring 2023 Homework 7: Regression Analysis Instructor: Dr. Naijun Zhou
Yes, I think it will be able to explain the relationship since the data appears to follow a linear pattern
between the independent and dependent variables and will be able to determine
a line of best fit for the data to show the general trend that the data conveys.
Question 2.
(1.5 points). Do a regression analysis “by hand” to determine the
cause-effect relation between trips and household income. You only need to determine the dependent and independent variables, and calculate the least square regression line (slope and intercept) and r
2
.
Independent variable(x)=trips per day and dependent variable(y)=household income
b=
n
(
xiyi
)
−(
xiyi
)
n
(
xi
2
)
−(
xi
)
2
= b=
12
(
3696
)
−(
73
∗
562
)
12
∗
479
−(
73
)
2
=
3326
419
=
7.94
a
=
yi
−
b
∗
xi
n
=
562
−
7.94
∗
73
12
=−
1.47
y
=
a
+
bx
=
¿
y=-1.47+7.94x r^2= ∑
(
yihat
−
ybar
)
2
∑
(
yi
−
ybar
)
2
= 2201.29/2537.68 = 0.87
A linear relationship exists with r^2=0.87
Question 3.
(1.5 points). Use software R
to plot a scatter gram of the independent variable and corresponding residual. Attach the scatter gram to this question. Based on the scatter gram and other information, discuss the residual pattern in terms of the four aspects illustrated in the lecture.
-2-
GEOG 306 Spring 2023 Homework 7: Regression Analysis Instructor: Dr. Naijun Zhou
Distribution of residuals appears
heteroscedastic. The residuals follow a normal distribution and the mean is about 0. The residuals variances are equal at different x values. The residuals are independent
Question 4.
(2 points). Do a hypothesis test to confirm whether household income is a determinant of household trips. You need to discuss the requirements, state the hypotheses, calculate the p
-value and make conclusion. Requirements: 1)random sample with paired data
2) a linear relationship between x and y
3)a normality for the residual errors
4)an equal(or constant) variance for the residual errors
5)Independence for the residual (Y)
6)Ratio or interval observation values
Hypothesis: H0:
ρ
2
=0 Ha:
ρ
2
≠0
F=
r
2
(
n
−
2
)
1
−
r
2
=
0.87
∗(
12
−
2
)
1
−
0.87
= 66.92 dfb=df1=1, dfw=df2=n-2=10 0.05<p-value> 0.1 pvalue=.09
There is weak evidence against H0, so it is likely we cannot reject H0
The Trips per day and household income follow a linear relationship, y=-1.47+7.94x
-3-
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
GEOG 306 Spring 2023 Homework 7: Regression Analysis Instructor: Dr. Naijun Zhou
-4-