You are on page 1of 9

X y

1 1
2 4
3 10 Regression Statistics
4 16 Multiple R 0.9733453232
5 24 R Square 0.9474011182
6 36 Adjusted R Square 0.940826258
7 50 Standard Error 8.3920958483
8 64 Observations 10
9 82
10 101 ANOVA
df SS MS
Regression 1 10148.18181818 10148.181818
Residual 8 563.4181818182 70.427272727
Total 9 10711.6

Coefficients Standard Error t Stat


Intercept -22.2 5.732892865392 -3.8723905228
X 11.090909091 0.923939344246 12.003936362

RESIDUAL OUTPUT

Observation Predicted y Residuals


1 -11.109090909 12.10909090909
2 -0.0181818182 4.018181818182
3 11.072727273 -1.07272727273
4 22.163636364 -6.16363636364
5 33.254545455 -9.25454545455
6 44.345454545 -8.34545454545
7 55.436363636 -5.43636363636
8 66.527272727 -2.52727272727
9 77.618181818 4.381818181818
10 88.709090909 12.29090909091
X
20

Residuals
10
0
-10 0 2
-20

F Significance F
144.09448819 2.1385149E-06

Note: If the residual plot is not norm

P-value Lower 95% Upper 95% Lower 95.0% Upper 95.0%


0.0047253427 -35.420074654 -8.9799253457 -35.420074654 -8.9799253457
2.138515E-06 8.9603011424 13.221517039 8.9603011424 13.221517039
X Residual Plot
20
Residuals

10
0
-10 0 2 4 6 8 10 12
-20
X

e residual plot is not normally distributed, then the linear model is not the right model for this data
City Sales Y - avg(Y) Y - avg(Y) squared Social Media ad (X) X - avg(X) X - avg(X) squared
1 973.00 -252.14 63,572.75 35.00 -6.86 47.11
2 1,119.00 -106.14 11,264.93 40.00 -1.86 3.47
3 875.00 -350.14 122,595.47 33.00 -8.86 78.56
4 625.00 -600.14 360,163.65 32.00 -9.86 97.29
5 910.00 -315.14 99,310.93 30.00 -11.86 140.75
6 971.00 -254.14 64,585.29 35.00 -6.86 47.11
7 931.00 -294.14 86,516.20 31.00 -10.86 118.02
8 1,177.00 -48.14 2,317.11 41.00 -0.86 0.75
9 882.00 -343.14 117,742.56 37.00 -4.86 23.65
10 982.00 -243.14 59,115.29 40.00 -1.86 3.47
11 1,628.00 402.86 162,299.11 55.00 13.14 172.56
12 1,577.00 351.86 123,808.02 50.00 8.14 66.20
13 1,044.00 -181.14 32,810.38 40.00 -1.86 3.47
14 914.00 -311.14 96,805.84 33.00 -8.86 78.56
15 1,329.00 103.86 10,787.65 42.00 0.14 0.02
16 1,330.00 104.86 10,996.38 42.00 0.14 0.02
17 1,405.00 179.86 32,350.93 45.00 3.14 9.84
18 1,436.00 210.86 44,463.47 45.00 3.14 9.84
19 1,521.00 295.86 87,535.29 48.00 6.14 37.65
20 1,741.00 515.86 266,115.29 52.00 10.14 102.75
21 1,866.00 640.86 410,706.20 58.00 16.14 260.38
22 1,717.00 491.86 241,929.84 57.00 15.14 229.11
SST SSx
26,953.00 2,507,792.59 921.00 1,530.59

1225.1364 41.86363636
625 30
1866 58

0.954378884
(Y - avg(Y)) * (X - avg(X)) P(Y) P(Y)-avg(Y) squared Errors Errors squared
1,730.57 959.99 70,304.43 -13.01 169.35
197.80 1,153.14 5,183.18 34.14 1,165.68
3,103.48 882.72 117,245.99 7.72 59.67
5,919.53 844.09 145,193.85 219.09 48,001.85
3,738.66 766.83 210,043.76 -143.17 20,497.35
1,744.30 959.99 70,304.43 -11.01 121.30
3,195.39 805.46 176,126.45 -125.54 15,759.75
41.57 1,191.77 1,113.10 14.77 218.25
1,668.89 1,037.25 35,301.76 155.25 24,102.17
453.12 1,153.14 5,183.18 171.14 29,289.60
5,292.16 1,732.61 257,528.00 104.61 10,942.94
2,862.89 1,539.45 98,794.97 -37.55 1,409.77
337.57 1,153.14 5,183.18 109.14 11,911.99
2,757.80 882.72 117,245.99 -31.28 978.17
14.16 1,230.40 27.75 -98.60 9,721.12
14.30 1,230.40 27.75 -99.60 9,919.32
564.12 1,346.30 14,680.03 -58.70 3,445.98
661.35 1,346.30 14,680.03 -89.70 8,046.53
1,815.53 1,462.19 56,194.82 -58.81 3,458.52
5,228.98 1,616.72 153,334.01 -124.28 15,446.70
10,341.21 1,848.50 388,584.50 -17.50 306.19
7,445.03 1,809.87 341,914.28 92.87 8,624.97
SSRe SSE R2
2,284,195.43 223,597.16 91%

MSRe MSE
2284195.43120624 11179.85798414
Sum of Sq Errors / DoF of regressSum of Sq Errors / DoF of residual
SUMMARY OUTPUT

Regression Statistics
Corr between the predicted and the actual Y values Multiple R 0.954378884
Sqrt of Multiple R R Square 0.910839054
Adjusted R Square 0.906381007
RMSE Standard Error 105.7348475
Observations 22

Assumes Social Media and Sales are dependent ANOVA


Therefore we only consider 1 column df SS
# independed variables Regression 1 2284195.431
Residual 20 223597.1597
# of observations - 1 Total 21 2507792.591

Coefficients Standard Error


Intercept -392.1019214 115.3663138
Social Media ad 38.6310991 2.702642355

Sum of (X-avgX)*(Y-avgY) = 59,128.41


Sum of (X-avgX)^2 = 1,530.59
Coeff of Regression of Ind. Variable X = 38.631099100169
[Sum of (X-avgX)*(Y-avgY)] / [Sum of (X-avgX)^2]

σ^2 11179.85798
(x-avg(x))^2 1,530.59

Variance of the Coefficient of X = σ^2 / (x-avg(x))^2 7.3042756974


Stdev of the Coefficient of X = σ / (x-avg(x)) 2.7026423547
Sales = -.392.102 + 38.63 * Social Media Ad Budget

MS F Significance F
2284195.431 204.3134568 5.84E-12
11179.85798 105.7348475

t Stat P-value Lower 95% Upper 95% Lower 95.0% Upper 95.0%
-3.398755741 0.0028 -632.7518351 -151.4520078 -632.7518351 -151.4520078
14.29382583 0 32.99348594 44.26871226 32.99348594 44.26871226

Here the mean of the coefficients is assumed to be 0


SUMMARY OUTPUT

Regression Statistics
Multiple R 0.954378883902
R Square 0.910839054038
Adjusted R Square 0.90638100674
Standard Error 105.7348475392
Observations 22

ANOVA
df SS MS F
Regression 1 2284195.431226 2284195.4312 204.3134568
Residual 20 223597.1596828 11179.857984
Total 21 2507792.590909

Coefficients Standard Error t Stat P-value


Intercept -392.1019214207 115.366313815 -3.3987557412 0.0028495221
Social Media ad 38.63109910017 2.702642355205 14.293825828 5.835944E-12

RESIDUAL OUTPUT

Observation Predicted Sales Residuals


1 959.9865470852 13.0134529148
2 1153.142042586 -34.142042586
3 882.7243488849 -7.72434888486
4 844.0932497847 -219.093249785
5 766.8310515844 143.1689484156
6 959.9865470852 11.0134529148
7 805.4621506845 125.5378493155
8 1191.773141686 -14.7731416862
9 1037.248745286 -155.248745286
10 1153.142042586 -171.142042586
11 1732.608529089 -104.608529089
12 1539.453033588 37.54696641226
13 1153.142042586 -109.142042586
14 882.7243488849 31.27565111514
15 1230.404240786 98.59575921361
16 1230.404240786 99.59575921361
17 1346.297538087 58.70246191311
18 1346.297538087 89.70246191311
19 1462.190835387 58.8091646126
20 1616.715231788 124.2847682119
21 1848.501826389 17.4981736109
22 1809.870727289 -92.8707272889
Social Media ad Residual Plot
200
100

Residuals
0
-10025.00 30.00 35.00 40.00 45.00 50.00 55.00 60.00
-200
-300
Social Media ad

Significance F
5.8359438E-12

Lower 95% Upper 95% Lower 95.0% Upper 95.0%


-632.75183508 -151.45200776 -632.75183508 -151.45200776
32.9934859362 44.268712264 32.993485936 44.268712264

You might also like