Linear Regression Diagnostic Analysis

Linear Regression Diagnostic Analysis 

Question 1:

Criminologists are interested in the effect of punishment regimes on crime rates. This has been studied using aggregate data on 47 states of the USA for 1960. The data subset contains the following columns. The complete dataset is provided in “Question1”.

together with following attribute description for this data:

Denoting the Crime Rate as Y please address the following below in the written report.

  1. Find the estimated linear regression of P91Ð] Ñ on an appropriate (“best”) subset of predictor variables \”ß á ß \14 using the 47 datapoints and interpret the resultsÞ Motivate your model development.
  1. Perform a diagnostic analysis of the fitted model chosen in Part A.
  2. Forecast the Crime Rate ] of a state for the following values of the independent

variables and provide a 95% prediction interval:

Question 2:

The spreadsheet ” Question2″ contains average response results on 17 attributes of 60 pea variations. Write a detailed analysis report as if you are conducting the analysis for a client and detail your analysis steps for this client. Analyze the pea attribute data using principal components.

Decide on the number of principal components to retain and why, and interpret the components. Decide if an increasing value of a pea attribute means “a pea” is judged better or worse in terms of that attribute and next design a “pea metric” using your pea attribute analysis, fit an appropriate theoretical distribution to the score results of your “pea metric” and select using your fitted distribution the top ten percent of peas that outperform the others. 

Solution 

Question1.xlsx 

Data Description

Variable
Crime Crimer rate: Number of offenses per 100,000 population in 1960
Po1 per capita expenditure in police protection in 1960
Po2 per capita expenditure in police protection in 1959
Wealth Wealth: Median value of transferrable assets or family income
Prob probability of imprisonment: ratio of number of commitment to number of offenses
Pop state population in 1960 in hundred thousands
Ed mean years of schooling of the population aged 25 years or over
U1 unemployment rate of urban males 14-24
U2 unemployment rate of urban males 35-39-24
LF labour force participation rate of civilian urban male in the age-group 14-24
M.F. number of males per 100 females
Ineq Income inequality: percentage of families earning below half the median income
Time average time in months served by offenders in state prisons before their first release
M percentage of males aged 14-24 in total state population

 US Crime Data

Crime Po1 Po2 Wealth Prob Pop Ed U1 U2 LF M.F Ineq Time M
791 5.8 5.6 3940 0.084602 33 9.1 0.108 4.1 0.51 95 26.1 26.2011 15.1
1635 10.3 9.5 5570 0.029599 13 11.3 0.096 3.6 0.583 101.2 19.4 25.2999 14.3
578 4.5 4.4 3180 0.083401 18 8.9 0.094 3.3 0.533 96.9 25 24.3006 14.2
1969 14.9 14.1 6730 0.015801 157 12.1 0.102 3.9 0.577 99.4 16.7 29.9012 13.6
1234 10.9 10.1 5780 0.041399 18 12.1 0.091 2 0.591 98.5 17.4 21.2998 14.1
682 11.8 11.5 6890 0.034201 25 11 0.084 2.9 0.547 96.4 12.6 20.9995 12.1
963 8.2 7.9 6200 0.0421 4 11.1 0.097 3.8 0.519 98.2 16.8 20.6993 12.7
1555 11.5 10.9 4720 0.040099 50 10.9 0.079 3.5 0.542 96.9 20.6 24.5988 13.1
856 6.5 6.2 4210 0.071697 39 9 0.081 2.8 0.553 95.5 23.9 29.4001 15.7
705 7.1 6.8 5260 0.044498 7 11.8 0.1 2.4 0.632 102.9 17.4 19.5994 14
1674 12.1 11.6 6570 0.016201 101 10.5 0.077 3.5 0.58 96.6 17 41.6 12.4
849 7.5 7.1 5800 0.031201 47 10.8 0.083 3.1 0.595 97.2 17.2 34.2984 13.4
511 6.7 6 5070 0.045302 28 11.3 0.077 2.5 0.624 97.2 20.6 36.2993 12.8
664 6.2 6.1 5290 0.0532 22 11.7 0.077 2.7 0.595 98.6 19 21.501 13.5
798 5.7 5.3 4050 0.0691 30 8.7 0.092 4.3 0.53 98.6 26.4 22.7008 15.2
946 8.1 7.7 4270 0.052099 33 8.8 0.116 4.7 0.497 95.6 24.7 26.0991 14.2
539 6.6 6.3 4870 0.076299 10 11 0.114 3.5 0.537 97.7 16.6 19.1002 14.3
929 12.3 11.5 6310 0.119804 31 10.4 0.089 3.4 0.537 97.8 16.5 18.1996 13.5
750 12.8 12.8 6270 0.019099 51 11.6 0.078 3.4 0.536 93.4 13.5 24.9008 13
1225 11.3 10.5 6260 0.034801 78 10.8 0.13 5.8 0.567 98.5 16.6 26.401 12.5
742 7.4 6.7 5570 0.0228 34 10.8 0.102 3.3 0.602 98.4 19.5 37.5998 12.6
439 4.7 4.4 2880 0.089502 22 8.9 0.097 3.4 0.512 96.2 27.6 37.0994 15.7
1216 8.7 8.3 5130 0.0307 43 9.6 0.083 3.2 0.564 95.3 22.7 25.1989 13.2
968 7.8 7.3 5400 0.041598 7 11.6 0.142 4.2 0.574 103.8 17.6 17.6 13.1
523 6.3 5.7 4860 0.069197 14 11.6 0.07 2.1 0.641 98.4 19.6 21.9003 13
1993 16 14.3 6740 0.041698 3 12.1 0.102 4.1 0.631 107.1 15.2 22.1005 13.1
342 6.9 7.1 5640 0.036099 6 10.9 0.08 2.2 0.54 96.5 13.9 28.4999 13.5
1216 8.2 7.6 5370 0.038201 10 11.2 0.103 2.8 0.571 101.8 21.5 25.8006 15.2
1043 16.6 15.7 6370 0.0234 168 10.7 0.092 3.6 0.521 93.8 15.4 36.7009 11.9
696 5.8 5.4 3960 0.075298 46 8.9 0.072 2.6 0.521 97.3 23.7 28.3011 16.6
373 5.5 5.4 4530 0.041999 6 9.3 0.135 4 0.535 104.5 20 21.7998 14
754 9 8.1 6170 0.042698 97 10.9 0.105 4.3 0.586 96.4 16.3 30.9014 12.5
1072 6.3 6.4 4620 0.049499 23 10.4 0.076 2.4 0.56 97.2 23.3 25.5005 14.7
923 9.7 9.7 5890 0.040799 18 11.8 0.102 3.5 0.542 99 16.6 21.6997 12.6
653 9.7 8.7 5720 0.0207 113 10.2 0.124 5 0.526 94.8 15.8 37.4011 12.3
1272 10.9 9.8 5590 0.0069 9 10 0.087 3.8 0.531 96.4 15.3 44.0004 15
831 5.8 5.6 3820 0.045198 24 8.7 0.076 2.8 0.638 97.4 25.4 31.6995 17.7
566 5.1 4.7 4250 0.053998 7 10.4 0.099 2.7 0.599 102.4 22.5 16.6999 13.3
826 6.1 5.4 3950 0.047099 36 8.8 0.086 3.5 0.515 95.3 25.1 27.3004 14.9
1151 8.2 7.4 4880 0.038801 96 10.4 0.088 3.1 0.56 98.1 22.8 29.3004 14.5
880 7.2 6.6 5900 0.0251 9 12.2 0.084 2 0.601 99.8 14.4 30.0001 14.8
542 5.6 5.4 4890 0.088904 4 10.9 0.107 3.7 0.523 96.8 17 12.1996 14.1
823 7.5 7 4960 0.054902 40 9.9 0.073 2.7 0.522 99.6 22.4 31.9989 16.2
1030 9.5 9.6 6220 0.0281 29 12.1 0.111 3.7 0.574 101.2 16.2 30.0001 13.6
455 4.6 4.1 4570 0.056202 19 8.8 0.135 5.3 0.48 96.8 24.9 32.5996 13.9
508 10.6 9.7 5930 0.046598 40 10.4 0.078 2.5 0.599 98.9 17.1 16.6999 12.6
849 9 9.1 5880 0.052802 3 12.1 0.113 4 0.623 104.9 16 16.0997 13

 Prediction Values

Po1 Po2 Wealth Prob Pop Ed U1 U2 LF M.F Ineq Time M
16 15 6890 0.01 168 12 0.14 5 0.6 107 27 44 17

Question2.xlsx 

Pea ID Tenderometer Dry matter Dry matter after freezing SucrosePercent TotalGlucose1 TotalGlucose2 Flavour Sweet Fruity Off-flavour Mealiness Hardness Whiteness Colour1 Colour2 Colour3 Skin
1 110.00 15.10 19.09 5.40 3.30 3.00 6.48 6.66 4.56 2.20 2.91 3.47 4.72 5.59 5.73 5.99 4.26
2 120.00 16.80 20.52 5.00 4.00 3.80 5.75 6.09 3.81 2.32 4.03 3.77 4.17 5.73 5.75 5.32 3.82
3 150.00 20.10 22.77 3.90 4.00 3.70 3.94 4.12 2.44 3.63 5.77 5.39 4.77 6.66 5.11 4.60 3.50
4 109.00 17.50 20.79 4.90 3.50 3.30 6.60 6.12 4.44 1.93 3.31 4.46 4.86 5.16 5.74 6.57 2.12
5 115.00 16.90 20.88 4.50 3.40 3.50 5.68 5.98 3.80 2.12 3.85 4.14 5.03 5.63 5.22 5.48 2.38
6 150.00 20.20 22.72 3.50 4.00 4.40 4.74 4.66 2.88 2.94 5.64 5.77 5.31 5.94 5.27 5.89 1.75
7 104.00 14.70 18.86 5.00 2.90 3.00 6.31 6.13 4.78 1.94 2.70 3.26 5.07 5.71 5.37 6.36 3.65
8 121.00 17.40 20.59 4.60 4.90 4.60 6.20 6.02 4.65 1.78 3.12 3.74 5.25 5.65 5.47 5.96 2.51
9 158.00 21.70 24.53 2.90 6.10 6.40 3.79 3.88 2.31 3.52 6.24 5.73 5.39 6.30 5.13 5.23 2.01
10 115.00 17.20 19.91 5.30 3.50 3.70 5.68 6.34 3.75 2.79 4.17 3.87 4.52 4.92 5.76 4.57 2.97
11 120.00 18.00 20.97 5.20 3.70 4.00 6.10 6.09 3.99 2.07 4.26 4.25 4.01 5.02 6.18 5.38 2.50
12 196.00 25.00 27.86 2.40 6.70 7.00 3.41 3.18 1.82 4.64 6.24 7.43 4.26 4.84 5.95 4.55 1.85
13 137.00 19.90 22.95 4.60 5.30 5.00 5.89 6.09 3.99 2.29 3.90 4.59 4.53 5.89 5.63 3.82 2.20
14 141.00 20.00 22.63 4.30 5.10 4.80 5.77 5.32 3.88 2.26 4.22 4.99 5.05 5.34 5.59 5.54 2.16
15 188.00 23.90 25.43 2.80 6.40 5.50 3.39 3.28 1.98 4.50 6.04 7.14 4.35 5.09 5.58 4.40 2.03
16 112.00 16.70 19.32 5.50 2.90 2.70 6.57 6.88 4.83 1.97 2.92 3.39 3.86 4.61 6.66 6.66 2.22
17 135.00 18.60 22.24 5.20 4.60 4.40 5.86 6.18 3.94 2.20 3.80 4.91 4.35 5.18 6.26 5.76 2.27
18 176.00 22.50 26.05 3.00 5.20 4.90 3.96 4.48 2.30 3.94 6.23 6.41 4.47 5.11 5.72 4.97 2.05
19 92.00 15.20 18.75 4.90 2.50 3.00 6.22 6.79 4.26 2.40 2.63 3.15 5.68 7.01 4.86 3.25 3.04
20 128.00 20.20 22.30 3.90 4.00 3.80 5.11 5.25 3.09 3.27 5.28 5.24 5.61 6.59 5.11 3.95 2.74
21 166.00 22.10 24.47 2.70 5.60 5.00 3.77 3.97 2.17 4.37 6.47 6.55 4.95 6.05 5.31 4.39 2.21
22 116.00 16.30 19.77 5.00 2.10 2.50 7.09 6.09 5.18 1.74 2.57 3.18 5.23 5.92 5.52 4.12 2.09
23 136.00 20.10 22.85 4.30 3.40 3.50 5.72 5.30 3.73 2.34 3.95 4.80 3.64 4.00 6.80 6.75 1.74
24 196.00 24.10 26.98 2.50 5.40 6.10 3.22 3.21 1.95 4.41 6.24 7.27 4.60 6.03 5.60 4.16 1.67
25 110.00 16.70 20.06 5.50 3.10 2.80 6.11 6.62 4.29 2.58 3.20 2.86 3.50 4.95 6.22 5.37 2.15
26 121.00 18.40 21.83 5.30 2.70 2.70 6.07 6.27 3.98 2.19 3.89 4.24 3.85 4.46 6.67 6.21 2.20
27 200.00 25.50 27.97 1.80 6.70 5.80 2.66 2.66 1.42 6.10 6.67 7.75 4.27 4.97 5.63 4.53 1.65
28 102.00 19.00 21.93 4.20 4.60 4.30 5.26 5.49 3.46 3.03 4.85 4.17 5.22 5.41 5.41 6.12 3.08
29 146.00 23.50 25.14 2.90 6.60 5.70 3.72 4.35 2.20 4.08 6.50 6.27 4.99 5.53 5.56 5.34 1.82
30 153.00 21.50 24.18 4.70 3.80 4.40 5.43 5.19 3.47 2.40 4.43 5.26 4.46 4.78 5.72 5.90 1.61
31 104.00 18.20 20.76 5.70 2.60 2.70 6.55 6.57 4.71 2.12 3.06 3.43 3.76 4.43 6.45 6.38 2.63
32 140.00 21.40 23.15 4.40 4.20 4.00 5.53 5.41 3.68 2.47 4.72 5.78 3.88 4.34 6.47 6.79 1.80
33 162.00 20.60 24.11 3.50 4.70 4.40 4.71 4.68 2.67 3.19 5.32 5.91 4.32 4.77 6.22 4.86 2.33
34 95.00 15.30 19.07 5.70 2.90 2.90 6.28 7.03 4.91 2.38 2.19 2.60 4.56 5.90 5.59 4.95 3.63
35 116.00 17.70 21.17 4.40 4.20 3.90 5.91 5.82 3.75 2.06 3.88 3.87 4.53 5.19 5.83 5.63 2.45
36 140.00 19.80 22.67 4.30 3.80 4.10 6.09 5.72 3.80 1.94 4.44 4.45 3.94 4.63 6.51 7.18 2.18
37 100.00 15.60 19.79 5.30 2.80 2.80 6.37 6.50 4.68 2.13 2.89 3.53 4.60 5.74 5.56 4.06 2.88
38 128.00 19.50 22.06 4.60 3.80 3.80 5.71 5.68 3.97 2.64 4.39 3.72 5.32 6.28 5.12 6.08 2.39
39 144.00 21.60 23.62 4.00 5.10 4.70 4.53 5.03 2.63 3.12 5.86 4.91 5.15 6.97 5.13 4.28 2.13
40 111.00 18.00 20.17 4.60 3.30 3.10 5.95 6.28 4.04 2.19 3.93 3.61 4.12 5.39 5.81 4.51 3.09
41 130.00 19.40 22.59 3.80 4.40 4.40 5.51 5.41 3.72 2.78 4.76 5.27 3.88 4.28 6.36 5.33 2.25
42 193.00 24.30 25.79 2.20 5.50 5.80 3.10 3.43 1.80 4.86 6.22 7.07 4.14 5.28 5.58 3.70 2.05
43 91.00 13.80 17.91 4.90 3.00 2.80 6.50 6.68 4.77 2.23 2.09 2.87 5.51 6.38 4.84 4.78 2.71
44 123.00 19.30 22.66 3.90 4.50 4.70 5.46 5.41 3.27 2.97 5.15 4.98 3.61 4.30 6.60 5.43 2.37
45 168.00 22.20 23.74 3.40 5.60 5.10 3.75 4.30 2.22 4.27 6.10 6.27 4.06 5.14 5.87 4.22 2.23
46 121.00 19.30 21.82 4.60 4.00 3.60 5.86 5.27 3.73 2.50 3.86 4.30 4.15 4.49 6.23 6.14 2.11
47 96.00 15.50 18.85 5.90 2.60 2.70 6.16 6.97 4.80 2.50 2.87 3.17 4.27 5.32 6.09 5.26 3.35
48 168.00 22.20 23.73 3.30 4.50 4.40 3.87 3.88 2.23 4.06 5.99 6.31 4.45 5.53 5.78 4.98 1.92
49 110.00 16.20 19.06 4.20 3.10 3.20 6.24 5.80 4.26 2.13 3.24 3.42 5.12 5.94 5.46 4.78 3.11
50 130.00 18.90 21.70 3.40 4.40 4.40 5.69 4.97 3.25 2.63 4.53 5.36 4.57 4.99 5.82 5.62 2.24
51 200.00 28.10 28.75 1.00 6.50 6.60 2.28 2.23 1.29 6.45 6.70 7.83 5.53 7.30 4.36 3.50 1.63
52 88.00 15.50 18.91 6.00 2.20 2.20 6.71 6.82 4.98 2.32 2.38 2.66 4.01 5.22 6.38 5.91 2.67
53 101.00 16.70 19.97 5.70 3.10 3.20 6.08 6.59 4.11 2.47 3.11 3.37 3.93 4.74 6.52 6.34 2.51
54 160.00 22.00 23.91 3.90 5.20 5.30 5.24 5.09 3.30 2.80 4.67 5.99 4.34 4.93 6.22 6.60 2.15
55 112.00 17.40 20.24 5.30 3.70 4.00 6.67 6.65 5.06 1.95 2.35 2.97 4.32 5.03 6.18 6.07 2.50
56 146.00 21.90 24.08 5.10 4.60 4.60 6.01 6.28 3.90 2.18 4.54 4.11 4.26 4.56 6.48 7.13 2.22
57 200.00 24.10 26.30 3.20 6.40 6.40 4.14 4.91 2.49 3.50 5.37 6.58 3.89 4.45 6.57 6.96 1.71
58 98.00 16.50 19.83 6.00 3.20 3.20 6.61 6.94 5.03 2.11 2.51 2.77 4.20 4.86 6.16 6.43 2.92
59 133.00 21.00 23.26 5.30 3.70 3.50 5.85 6.26 4.06 2.30 4.26 3.99 5.03 5.91 5.53 4.84 1.98
60 180.00 23.80 24.75 3.10 6.10 5.60 3.70 3.86 2.33 4.11 6.18 6.83 5.15 5.77 5.29 4.41 1.99