Individual Assignment 02 - Regression Analysis
Individual Assignment 02 - Regression Analysis
Age of the machine Machine work time Machine Idle time Price of running a machine
56 57 12 66.9
49 39 10.2 61.1
40 38 8.1 45
45 19 4.2 44.3
33 35 5 39
30 82 6.1 36.5
33 32 5.8 36.2
31 33 6 35
29 47 5 29
15 29 2.8 24.3
19 45 3.6 23
16 61 3.2 22.3
15 27 2.5 22.1
14 23 2.3 19.1
14 47 1.7 18
33 10 3.6 18
11 36 1.9 17.3
4 24 1.5 12.5
2 42 0.8 8
3 40 0.9 8
5 42 2.1 10
2. Conduct correlation analysis for all inputs and outputs and interpret the result.
From the data analysis correlation calculation in excel we can analyze the results as follows:
This indicates a very weak positive correlation. There's almost no linear relationship
between the age of the machine and the time it's worked. Knowing the age of the machine
tells you virtually nothing about its work time, and vice-versa.
This is a very strong positive correlation. Older machines tend to have much more idle
time, which makes sense as older machines might be less reliable or efficient, leading to
more downtime.
This is also a very strong positive correlation. Older machines are significantly associated
with higher running costs because of the over time increased maintenance, repairs, and
potentially lower efficiency for older machines.
This suggests a weak positive correlation. Which suggests that theres a slight chance for
machines with more work time to also have more idle time. However, the relationship is
not very strong.
This is a very strong positive correlation. Machines with more idle time are strongly
associated with higher running costs. This is a very important data as it suggests that idle
time is sure to increase the cost of running a machine.
3. Conduct a univariate analysis for Price of running a machine vs Machine work time
(time worked per batch). Plot the observations in a scatter plot and state the
univariate regression function. Predict the Hourly Cost of running a machine for
Machine work time =20. Calculate the error (predicted minus actual) for each
observation.
70
60
50
40
30
20
10
0
0 10 20 30 40 50 60 70 80 90
Here the graph shows a weak positive trend, as indicated by the correlation.
From the above regression data we can use:
Intercept: 20.3185619 and Machine work time Coefficient: 0.209047277
So the univariate regression function is: Price = 20.3185619 + 0.209047277 * (Machine
work time)
Price = 20.3185619 + 0.209047277 * 20
Price = 20.3185619 + 4.18094554
Price = 24.49950744
Therefore, the predicted price of running a machine for a work time of 20 is
approximately $24.50.
Now for error Excel Calculation for all observations: (Predicted price – given price)
Machine work time Price of running a machine Predicted price Errror residual
57 66.9 32.23425669 -34.66574331
39 61.1 28.4714057 -32.6285943
38 45 28.26235843 -16.73764157
19 44.3 24.29046016 -20.00953984
35 39 27.6352166 -11.36478341
82 36.5 37.46043861 0.960438614
32 36.2 27.00807476 -9.191925236
33 35 27.21712204 -7.782877959
47 29 30.14378392 1.143783919
29 24.3 26.38093293 2.080932933
45 23 29.72568937 6.725689365
61 22.3 33.0704458 10.7704458
27 22.1 25.96283838 3.862838379
23 19.1 25.12664927 6.026649271
47 18 30.14378392 12.14378392
10 18 22.40903467 4.40903467
36 17.3 27.84426387 10.54426387
24 12.5 25.33569655 12.83569655
42 8 29.09854753 21.09854753
40 8 28.68045298 20.68045298
42 10 29.09854753 19.09854753
4. Conduct a univariate analysis for Price of running a machine vs Age. Plot the
observations in a scatter plot and state the univariate regression function. Predict the
Hourly Cost of running a machine for Age =12. Calculate the error (predicted minus
actual) for each observation.
5. Conduct a univariate analysis for Price of running a machine vs Machine Idle Time. Plot
the observations in a scatter plot and state the univariate regression function. Predict the
Hourly Cost of running a machine for machine ideal time= 4. Calculate the error
(predicted minus actual) for each observation.
o Take snapshots of your summary outputs. State the whole process from initiation
to getting the regression function (Hint: Look at p-values).
o State your final multivariate regression function.
o Predict the Price of running a machine for machine idle time = 15, age = 10 and
machine work time = 20
o Calculate error for each observation. ( Error = Predicted Value minus Actual)
Age of the machine Machine work time Machine Idle time Price of running a machine Error
56 57 12 66.9 ?
49 39 10.2 61.1 ?
40 38 8.1 45 ?
45 19 4.2 44.3 ?
33 35 5 39 ?
30 82 6.1 36.5 ?
33 32 5.8 36.2 ?
31 33 6 35 ?
29 47 5 29 ?
15 29 2.8 24.3 ?
19 45 3.6 23 ?
16 61 3.2 22.3 ?
15 27 2.5 22.1 ?
14 23 2.3 19.1 ?
14 47 1.7 18 ?
33 10 3.6 18 ?
11 36 1.9 17.3 ?
4 24 1.5 12.5 ?
2 42 0.8 8 ?
3 40 0.9 8 ?
5 42 2.1 10 ?