MATH 252
Day 1 Worksheet
Due 7 Fe
uary 2022
Consider Hartford’s crime rate (of some measurement) and unemployment rate.
Year Crime Rate Percent Unemployment
XXXXXXXXXX%
XXXXXXXXXX%
XXXXXXXXXX%
XXXXXXXXXX%
XXXXXXXXXX%
XXXXXXXXXX%
XXXXXXXXXX%
XXXXXXXXXX%
XXXXXXXXXX%
XXXXXXXXXX%
Day 1 Worksheet Due 7 Fe
uary 2022
Listing 1: Hartford Crime, Unemployment Rates
1 % data format: year, crime rate, unemployment rate
2 hartfordData(1,:) = [2010, 589.1, 9.6];
3 hartfordData(2,:) = [2011, 609.7, 9.0];
4 hartfordData(3,:) = [2012, 582.2, 8.3];
5 hartfordData(4,:) = [2013, 544.3, 7.9];
6 hartfordData(5,:) = [2014, 524.4, 6.6];
7 hartfordData(6,:) = [2015, 564.0, 5.6];
8 hartfordData(7,:) = [2016, 521.6, 4.9];
9 hartfordData(8,:) = [2017, 520.7, 4.4];
10 hartfordData(9,:) = [2018, 481.6, 3.9];
11 hartfordData(10,:) = [2019, 379.9, 3.6];
12
13 crime = hartfordData(:,2);
14 unemployment = hartfordData(:,3);
15
16 scatter(unemployment,crime,'filled','o')
1. What does each line of the code above do? How are items being stored in MATLAB (scalars,
vectors, matrices, etc.)? A template for the code above is saved on Moodle with the file
hartford_crime_unemployment_class.m.
2. In MATLAB, use the code from lecture (about net income of Meta) as a starting point to
construct a linear and quadratic fit for the data. Save your script as a .m file with the form:
YourLastNames_Day1Groupwork.m.
3. Is a linear fit appropriate? What about a quadratic fit? In MATLAB, measure the e
or of each
fit.
4. What about a ninth-order polynomial– is it appropriate? It goes through every point (i.e., the
e
or of the fit is 0), but why is this probably not the best option to model this data set?
5. What are other options we could consider in looking for trends with this data? What othe
elationships between the three variables listed could we look at?
6. Is our model (either linear or quadratic) good? Justify your answer.
7. How would you go about predicting the crime rate for 2020 if the unemployment rate that yea
was 7.7%? Then, make a prediction about the crime rate for a year with of 7.7% unemployment.
Justify your answer.