Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

Homework 5 - Basic Regression

Rating
-
Sold
-
Pages
8
Grade
A+
Uploaded on
15-10-2024
Written in
2024/2025

Homework 5 - Basic Regression

Institution
Intro To Analytics Modeling
Course
Intro to Analytics Modeling

Content preview

10/15/24, 9:18 Homew ork 5 - Basic
AM Regression




Question 8.1

Describe a situation or problem from your job, everyday life, current events, etc., for which a linear
regression model would be appropriate. List some (up to 5) predictors that you might use.

Solution:

I have a little company that sells pipe hookah tobacco and we can use a linear regression model to
understand the correlation between the amount of money we spend for advertising and revenue. We
can fit a simple linear regression model with one predictor variable – Ads spending and the revenue as
the response variable.

We are using the ads spending as predictor because that is the effect we want to study; but in general,
revenue can have many other predictors such as price, number of competitors, unemployment rate.



Question 8.2

Using crime data from http://www.statsci.org/data/general/uscrime.txt (file uscrime.txt, description at
http://www.statsci.org/data/general/uscrime.html ), use regression (a useful R function is lm or glm)
to predict the observed crime rate in a city with the following data:

M = 14.0

So = 0

Ed = 10.0

Po1 = 12.0

Po2 = 15.5

LF = 0.640

M.F = 94.0

Pop = 150

NW = 1.1

U1 = 0.120

U2 = 3.6

Wealth = 3200

Ineq = 20.1

Prob = 0.04

Time = 39.0




about:bl 1

, 10/15/24, 9:18 Homew ork 5 - Basic
AM Regression




Show your model (factors used and their coefficients), the software output, and the quality of fit.



Note that because there are only 47 data points and 15 predictors, you’ll probably notice some
overfitting. We’ll see ways of dealing with this sort of problem later in the course.



Solution:

To approach this problem, we first fitted a regression model (Model1) using all the 47 data
points. Since we have a small data set, we decided not to split the data into train-test.

After we fitted and analyzed “Model1” output, we noted that predictors like “Mean years of schooling
of the population aged 25 years or over”(Ed) and “Income inequality: percentage of families earning
below half the median income”(Ineq) have less impact on the model since their coefficients are below
or equal to 0.001. So, we decided to create another model (Model2) without “Ed” and “Ineq” predictors
to see if we get a better-quality model.

However, after computing and comparing the sum of squared error for both models, we found that
“Model1” has the least sum of squared error - Model1 sum of squared error= 1354946, Model2 sum of
squared error= 2038089. Also looking at the Adjusted R-squared values, we see that “Model1” has
greater R-squared (which mean that Model1 accounted more for the variability in the data).

So, in sum, we ended up working with “Model1” to predict the test city crime based on data
provided above and we got a crime rate of 155 per 100000 population.

Below is the output details of Model1:


lm(formula = Crime ~ ., data = uscrimeData)

Residuals:
Min 1Q Median 3Q Max
-395.74 -98.09 -6.69 112.99 512.67

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -5.984e+03 M 1.628e+03 -3.675 0.000893 ***
4.171e+01 2.106 0.043443 *
8.783e+01 1.488e+02 -0.026 0.979765
So -3.803e+00
Ed 6.209e+01 3.033 0.004861 **

1.883e+02
Po1 1.061e+02 1.817 0.078892 .
1.175e+02 -0.931 0.358830
1.928e+02 1.470e+03 -0.452 0.654654
Po2 -1.094e+02 2.035e+01 0.855 0.398995
LF -6.638e+02
M.F
1.741e+01
Pop -7.330e-01 1.290e+00 -0.568 0.573845
NW 6.481e+00 0.649 0.521279
4.210e+03 -1.384 0.176238
4.204e+00 8.234e+01 2.038 0.050161 .
U1 -5.827e+03
U2

1.678e+02
Wealth 9.617e-02 1.037e-01 0.928 0.360754
Ineq 7.067e+0 2.272e+01 3.111 0.003983 **
1
Prob -4.855e+03 2.272e+03 -2.137 0.040627 *
Time -3.479e+00 7.165e+00 -0.486 0.630708



about:bl 2

Written for

Institution
Intro to Analytics Modeling
Course
Intro to Analytics Modeling

Document information

Uploaded on
October 15, 2024
Number of pages
8
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$12.99
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
EXAMSHAVEN1

Get to know the seller

Seller avatar
EXAMSHAVEN1 Stanford University
View profile
Follow You need to be logged in order to follow users or courses
Sold
2
Member since
1 year
Number of followers
0
Documents
924
Last sold
11 months ago
A+ GRADE FOR NURSING EXAMS

Success is the sum of small efforts - repeated day in and day out. I am here to help in the precise way possible. Day in day out I will be updating you \\\'all with the latest exams not only in nursing but also in other areas. Don\\\'t forget to check out my store and recommend it to a friend. I will be uploading LATEST TESTBANKS TOO.

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions