You are on page 1of 21

33.

1* Frequency array function to find out frequency distribution


33.2 Using the Index function
33.3 Basic statistical functions (variance, std. dev, correlation, etc.)
33.4 Simple Linear Regression using (1) Basic formulas (2) Data-Data Analysis (3) Linest [Also discusses multiple regre
33.5 Multiple Linear Regression (Modeling analyst following)
33.6 Multiple Linear Regression: Precited v. Actual
33.7 Using VLOOKUP function
33.8 Using VLOOKUP function when an exact match is required

* In Chapter 34 of the textbook


o discusses multiple regression at the end]
A B C D E F G H I J K L M
1 Ex 33.1: Compute the frequency distribution of the monthly returns on the stock of Texas Instruments during Jan 2000 - Dec 2009 (Frequency Array Function)
2
3 Return Minimum -32.5% #VALUE! Start -35%
4 Jan-00 54.18% Maximum 54.2% #VALUE! Step 5%
5 Feb-00 -3.69%
6 Mar-00 1.82% Bins Frequencies
7 Apr-00 -11.27% -35% 0 #VALUE!
8 May-00 -4.93% -30% 1
9 Jun-00 -13.35% -25% 2
10 Jul-00 12.19% -20% 4
11 Aug-00 -28.84% -15% 2
12 Sep-00 3.32% -10% 14
13 Oct-00 -23.94% -5% 14
14 Nov-00 26.95% 0% 27
15 Dec-00 -7.49% 5% 16
16 Jan-01 -32.53% 10% 17
17 Feb-01 4.82% 15% 15
18 Mar-01 25.00% 20% 2
19 Apr-01 -11.83% 25% 0
20 May-01 -6.53% 30% 5
21 Jun-01 8.25% 35% 0
22 Jul-01 -4.06% 40% 0
23 Aug-01 -24.55% 45% 0
24 Sep-01 12.14% 50% 0
25 Oct-01 14.51% 55% 1
26 Nov-01 -12.64%
27 Dec-01 11.55%
28 Jan-02 -5.94% Frequency Distribution of Returns
29 Feb-02 12.75% 30
30 Mar-02 -6.49%
Frequency

25
31 Apr-02 -7.29%
32 May-02 -17.35% 20
33 Jun-02 -2.20%
34 Jul-02 -14.92% 15

35 Aug-02 -25.01% 10
36 Sep-02 7.55%
37 Oct-02 26.11% 5
38 Nov-02 -24.97%
0
39 Dec-02 6.05%
40 Jan-03 5.37% 5% 30% 25% 20% 15% 10% -5% 0% 5% 10% 15% 20% 25% 30% 35% 40% 45% 50% 55%
-3 - - - - -
41 Feb-03 -2.26%
42 Mar-03 13.06% Return
43 Apr-03 10.85%
44 May-03 -14.11%
Ex33.1
A B C D E F G H I J K L M
45 Jun-03 7.29%
46 Jul-03 26.38%
47 Aug-03 -4.38%
48 Sep-03 26.94%
49 Oct-03 2.90%
50 Nov-03 -1.27%
51 Dec-03 6.78%
52 Jan-04 -2.26%
53 Feb-04 -4.63%
54 Mar-04 -14.06%
55 Apr-04 4.03%
56 May-04 -7.37%
57 Jun-04 -11.69%
58 Jul-04 -8.41%
59 Aug-04 8.91%
60 Sep-04 15.04%
61 Oct-04 -1.10%
62 Nov-04 1.82%
63 Dec-04 -5.62%
64 Jan-05 14.04%
65 Feb-05 -3.68%
66 Mar-05 -2.02%
67 Apr-05 10.77%
68 May-05 1.55%
69 Jun-05 13.16%
70 Jul-05 2.90%
71 Aug-05 3.70%
72 Sep-05 -15.67%
73 Oct-05 13.75%
74 Nov-05 -1.25%
75 Dec-05 -8.77%
76 Jan-06 2.12%
77 Feb-06 8.77%
78 Mar-06 7.01%
79 Apr-06 -10.02%
80 May-06 -3.01%
81 Jun-06 -1.59%
82 Jul-06 9.42%
83 Aug-06 2.03%
84 Sep-06 -9.11%
85 Oct-06 -2.08%
86 Nov-06 -2.56%
87 Dec-06 8.43%
88 Jan-07 -0.72%
Ex33.1
A B C D E F G H I J K L M
89 Feb-07 -2.78%
90 Mar-07 14.45%
91 Apr-07 2.87%
92 May-07 6.42%
93 Jun-07 -6.29%
94 Jul-07 -2.68%
95 Aug-07 6.86%
96 Sep-07 -10.62%
97 Oct-07 -3.17%
98 Nov-07 5.78%
99 Dec-07 -7.02%
100 Jan-08 -3.20%
101 Feb-08 -5.65%
102 Mar-08 3.50%
103 Apr-08 11.40%
104 May-08 -13.30%
105 Jun-08 -13.07%
106 Jul-08 0.51%
107 Aug-08 -12.27%
108 Sep-08 -8.50%
109 Oct-08 -20.38%
110 Nov-08 -0.33%
111 Dec-08 -3.01%
112 Jan-09 -4.00%
113 Feb-09 15.09%
114 Mar-09 10.05%
115 Apr-09 7.43%
116 May-09 9.82%
117 Jun-09 13.41%
118 Jul-09 2.25%
119 Aug-09 -3.69%
120 Sep-09 -0.47%
121 Oct-09 7.83%
122 Nov-09 3.05%
123 Dec-09 -11.09%

Ex33.1
UN-22M

A B C D E F G H I J K L M N
1 Ex 33.2: Pick an entry from an array (Index function)
2 We are given below a 12 x 3 array of monthly returns during 2006
3 on stocks of Apple, GM, and Walmart.
4 We want to identify the return during June 2006 on the stock of GM.
5 Another Example
6 Apple Comp. General Motors Walmart
7 The elements of the array could be a mix of text and numbers.
8 Jan-06 5.0% 23.9% -1.5% We are given below a 3 x 3 array.
9 Feb-06 -9.3% -14.5% -1.6% We want to find out the element in the 2nd row & 3rd column.
10 Mar-06 -8.4% 4.7% 4.5%
11 Apr-06 12.2% 7.6% -4.7% a b 3
12 May-06 -15.1% 18.8% 8.0% Simon 6 Howie
13 Jun-06 -4.2% 10.6% -0.6% q 7 Jack
14 Jul-06 18.7% 8.2% -7.6%
15 Aug-06 -0.2% -8.7% 0.9% Howie #VALUE!
16 Sep-06 13.5% 14.0% 10.3%
17 Oct-06 5.3% 5.0% -0.1%
18 Nov-06 13.0% -15.6% -6.5%
19 Dec-06 -7.4% 5.1% 0.5%
20
21 10.6% #VALUE!
UN-22S

A B C D E
1 Example 33.3: Basic statistical functions (variance, std. dev, correlation, etc.)
2 (X) (Y)
3 Return on S&P 500 Return on stock of Target
4 Jan-06 2.5% -0.4%
5 Feb-06 0.0% -0.5%
6 Mar-06 1.1% -4.4%
7 Apr-06 1.2% 2.1%
8 May-06 -3.1% -7.7%
9 Jun-06 0.0% -0.1%
10 Jul-06 0.5% -6.0%
11 Aug-06 2.1% 5.6%
12 Sep-06 2.5% 14.2%
13 Oct-06 3.2% 7.1%
14 Nov-06 1.6% -1.6%
15 Dec-06 1.3% -1.8%
16
17 Average 0.0108 0.0054 #VALUE!
18 Sample Variance 0.0003 0.0037 #VALUE!
19 Population Variance 0.0002 0.0034 #VALUE!
20 Sample Std. Deviation 0.0164 0.0607 #VALUE!
21 Population Std. Deviation 0.0157 0.0581 #VALUE!
22
23 Correlation 0.6790 #VALUE!
24 Covariance (Sample) 0.0007 #VALUE!

Page 7
UN-22S

A B C D E F G H I J
1 Example 33.4: Linear Regression using (1) Basic formulas (2) Data-Data Analysis (3) Linest
2 (X) (Y)
3 Return on S&P 500 Return on stock of Target
4 Jan-06 2.5% -0.4%
5 Feb-06 0.0% -0.5%
6 Mar-06 1.1% -4.4%
7 Apr-06 1.2% 2.1%
8 May-06 -3.1% -7.7%
9 Jun-06 0.0% -0.1%
10 Jul-06 0.5% -6.0%
11 Aug-06 2.1% 5.6%
12 Sep-06 2.5% 14.2%
13 Oct-06 3.2% 7.1%
14 Nov-06 1.6% -1.6%
15 Dec-06 1.3% -1.8%
16
17 (1) Basic Formulas
18
19 Regression intercept -0.0217 #VALUE!
20 Regression slope 2.5058 #VALUE!
21 Regression r-squared 0.4610 #VALUE!
22 Regression r-squared (as the square of the correlation 0.4610 #VALUE!
23
24 (2) Data-Data Analysis-Regression
25
26 SUMMARY OUTPUT
27
28 Regression Statistics
29 Multiple R 0.6789598573
30 R Square 0.4609864878
31 Adjusted R Square 0.4070851366
32 Standard Error 0.0467385741
33 Observations 12
34
35 ANOVA
36 df SS MS F Significance F
37 Regression 1 0.0186826923 0.0186826923 8.5524106 0.0151843333
38 Residual 10 0.0218449431 0.0021844943
39 Total 11 0.0405276353
40
41 Coefficients Standard Error t Stat P-value Lower 95% Upper 95% Lower 95.0%Upper 95.0%
42 Intercept -0.0216806034 0.016371346 -1.324301827 0.21487191 -0.058158235 0.0147970286 -0.058158 0.014797
43 X Variable 1 2.5058300886 0.8568550251 2.9244504791 0.01518433 0.5966381167 4.4150220605 0.5966381 4.415022
44
45
46
47 (3) Using Linest
48
49
50
51 Slope --> 2.5058300886 -0.0216806034 <-- Intercept
52 Standard error of slope --> 0.8568550251 0.016371346 <-- Standard error of intercept
53 R2 --> 0.4609864878 0.0467385741 <-- Std error of y values (also =Steyx(D4:D13,C4:C13) )
54 F statistic --> 8.5524106047 10 <-- Degrees of freedom
55 SSxy = Slope*(summed product of observations from means) --> 0.0186826923 0.0218449431 <-- SSE = Residual sum of squares

Page 8
Example 33.5: Multiple Linear Regression using (1) Data-Data Analysis (2) Linest
We want to model the relationship between the number of financial analysts that follow a firm and firm size, % institutional own

Company MVE Institutions DtoE Analysts


3M CO 46.26 66.2% 0.03 14
AIRBORNE INC 0.71 72.1% 0.31 10
ALCOA INC 30.13 71.3% 0.21 19
ALLIANT ENERGY CORP 2.72 31.3% 0.90 4
APPLEBEES INTL INC 1.27 84.7% 0.06 13
AVON PRODUCTS 11.01 80.3% 0.11 15
BALL CORP 2.04 80.7% 0.46 8
BELLSOUTH CORP 71.61 44.9% 0.21 21
CALLAWAY GOLF CO 1.49 63.9% 0.00 8
CARLISLE COS INC 1.12 51.7% 0.41 3
CHECKPOINT SYSTEMS INC 0.43 69.6% 0.61 4
CHESAPEAKE CORP 0.42 57.5% 1.16 2
CINERGY CORP 5.33 61.7% 0.73 17
COCA-COLA CO 117.23 52.5% 0.01 18
COLGATE-PALMOLIVE CO 31.80 64.3% 0.09 20
CONSOLIDATED EDISON INC 8.56 35.8% 0.65 15
CORNING INC 8.22 52.0% 0.54 21
CSX CORP 7.49 64.5% 0.78 9
DAVITA INC 2.07 83.9% 0.39 7
DOLLAR TREE STORES INC 3.48 84.4% 0.01 12
DYNEGY INC 9.05 82.5% 0.58 17
EARTHLINK INC 1.80 54.8% 0.00 8
EASTMAN CHEMICAL CO 3.00 75.1% 0.71 10
EASTMAN KODAK CO 8.56 63.3% 0.19 9
EATON CORP 5.17 69.3% 0.44 11
ECOLAB INC 5.15 49.6% 0.10 10
EDISON INTERNATIONAL 4.92 63.6% 2.79 13
ELECTRONIC DATA SYSTEMS 32.72 77.0% 0.14 25
EMC CORP/MA 29.84 53.5% 0.00 28
ENGELHARD CORP 3.57 81.4% 0.07 13
ENSCO INTERNATIONAL INC 3.34 81.3% 0.14 26
ENTERGY CORP 8.63 69.6% 0.89 15
EOG RESOURCES INC 4.52 82.5% 0.19 27
EPICOR SOFTWARE CORP 0.07 29.7% 0.03 2
EQUIFAX INC 3.29 59.3% 0.21 9
EQUITABLE RESOURCES INC 2.18 60.4% 0.18 10
EXELON CORP 15.37 60.0% 0.87 18
EXTENDED STAY AMERICA IN 1.53 64.8% 0.74 9
FANNIE MAE 79.26 78.8% 5.30 22
FEDERAL SIGNAL CORP 1.01 60.2% 0.23 4
FERRO CORP 0.89 82.2% 0.94 8
FIDELITY NATIONAL FINL INC 2.12 65.9% 0.24 6
FIRST AMERICAN CORP/CA 1.29 61.9% 0.38 7
FIRST DATA CORP 29.85 81.6% 0.09 23
FIRST VIRGINIA BANKS INC 2.43 27.7% 0.01 13
FIRSTENERGY CORP 10.41 53.7% 1.15 15
FIRSTMERIT CORP 2.30 28.8% 0.25 14
FISERV INC 8.05 79.8% 0.04 24
FISHER SCIENTIFIC INTL INC 1.58 87.9% 0.60 5
FLEETBOSTON FINANCIAL CO 38.10 60.0% 0.67 24
FLOWSERVE CORP 1.19 82.1% 0.84 6
FORTUNE BRANDS INC 5.86 59.9% 0.16 12
FPL GROUP INC 9.92 55.4% 0.49 24
FREMONT GENERAL CORP 0.55 41.8% 0.80 1
FRONTIER OIL CORP 0.43 68.8% 0.49 3
FROZEN FOOD EXPRESS IND 0.04 22.6% 0.05 1
FURNITURE BRANDS INTL INC 1.75 90.0% 0.26 10
GANNETT CO 17.87 73.2% 0.28 15
GARDNER DENVER INC 0.35 71.6% 0.46 2
GENERAL DYNAMICS CORP 15.99 64.4% 0.05 15
GENERAL ELECTRIC CO 397.83 47.5% 0.20 20
GEORGIA GULF CORP 0.59 66.4% 0.99 6
GILEAD SCIENCES INC 6.34 86.9% 0.04 13
GILLETTE CO 35.27 65.2% 0.05 15
GLATFELTER 0.67 71.8% 0.23 2
GOLDEN WEST FINANCIAL CO 9.15 63.7% 2.06 13
GREEN MOUNTAIN POWER C 0.11 23.9% 0.76 0
GUIDANT CORP 15.20 79.5% 0.03 32
J P MORGAN CHASE & CO 71.73 59.8% 0.61 20
JEFFERSON-PILOT CORP 6.94 48.7% 0.06 12
JOHNSON & JOHNSON 180.09 58.2% 0.01 28
JONES APPAREL GROUP INC 4.17 88.8% 0.23 19
K2 INC 0.13 57.9% 0.76 1
KANSAS CITY SOUTHERN 0.84 53.9% 0.73 4
KAYDON CORP 0.69 73.4% 0.16 5
KELLOGG CO 12.24 78.3% 0.46 16
KERR-MCGEE CORP 5.49 81.0% 0.83 21
KEYCORP 10.32 53.4% 1.54 18
KEYSPAN CORP 4.83 39.3% 0.97 12
KIMBERLY-CLARK CORP 31.16 66.2% 0.08 14
KINDER MORGAN INC 6.90 58.3% 0.39 11
KIRBY CORP 0.66 57.7% 0.38 5
KNIGHT-RIDDER INC 5.45 74.3% 0.29 12
LABOR READY INC 0.21 55.7% 0.02 3
LABORATORY CP OF AMER H 5.70 82.2% 0.09 13
LANCE INC 0.41 36.5% 0.12 2
LANDAMERICA FINANCIAL GP 0.53 74.0% 0.39 5
LANDRYS RESTAURANTS INC 0.41 63.2% 0.43 4
LANDSTAR SYSTEM INC 0.59 88.6% 0.16 6
LATTICE SEMICONDUCTOR C 2.25 93.5% 0.12 11
LAWSON PRODUCTS 0.25 33.3% 0.04 0
LEAR CORP 2.45 86.5% 0.94 20
LEGGETT & PLATT INC 4.51 55.2% 0.22 13
LEUCADIA NATIONAL CORP 1.60 36.0% 0.27 1
LIBBEY INC 0.50 76.4% 0.01 6
LILLY (ELI) & CO 88.23 62.6% 0.04 29
LINCARE HOLDINGS INC 3.09 88.5% 0.04 7
LINCOLN NATIONAL CORP 9.08 64.0% 0.15 20
LIZ CLAIBORNE INC 2.62 49.8% 0.15 18
LOEWS CORP 10.60 53.5% 0.53 3
LONE STAR TECHNOLOGIES 0.44 73.1% 0.34 8
LOUISIANA-PACIFIC CORP 0.88 60.3% 1.31 9
LSI LOGIC CORP 5.81 58.8% 0.23 17
LUBRIZOL CORP 1.79 73.3% 0.22 6
LYDALL INC 0.16 73.9% 0.11 3
LYONDELL CHEMICAL CO 1.68 79.5% 2.28 12
MAF BANCORP INC 0.67 42.1% 2.19 7
MANPOWER INC/WI 2.57 81.7% 0.32 13
MARSH & MCLENNAN COS 29.48 64.7% 0.08 20
MARSHALL & ILSLEY CORP 6.58 33.1% 0.36 14
MARTIN MARIETTA MATERIAL 2.26 85.2% 0.35 9
MASCO CORP 11.25 74.5% 0.32 15
MATTEL INC 7.41 76.8% 0.14 12
MBIA INC 7.96 86.1% 0.86 10
MBNA CORP 29.98 69.2% 0.23 25
MCDONALDS CORP 33.90 60.3% 0.25 18
MCGRAW-HILL COMPANIES 11.78 64.7% 0.07 14
MDC HOLDINGS INC 1.00 60.3% 0.17 6
MDU RESOURCES GROUP INC 1.96 29.4% 0.40 16
MEDIMMUNE INC 9.94 59.2% 0.00 19
MELLON FINANCIAL CORP 16.80 60.1% 0.34 22
MENTOR GRAPHICS CORP 1.53 88.3% 0.00 9
MERCURY INTERACTIVE COR 2.79 82.9% 0.14 20
MERRILL LYNCH & CO 44.18 61.8% 1.29 16
MILLIPORE CORP 2.91 86.1% 0.11 8
MOHAWK INDUSTRIES INC 2.89 85.1% 0.05 7
MOODYS CORP 6.15 77.4% 0.05 5
MUELLER INDUSTRIES 1.11 64.4% 0.04 2
NICOR INC 1.85 42.6% 0.24 10
QUAKER CHEMICAL CORP 0.19 48.2% 0.10 2
QUEST DIAGNOSTICS INC 6.89 57.0% 0.12 12
SOUTHWEST AIRLINES 14.17 70.0% 0.09 15

SUMMARY OUTPUT

Regression Statistics
Multiple R 0.4353502634
R Square 0.1895298518
Adjusted R Square 0.1705344577
Standard Error 6.644232351
Observations 132

ANOVA
df SS MS F Significance F
Regression 3 1321.41792098 440.47264 9.977674 5.884772E-06
Residual 128 5650.66541235 44.1458235
Total 131 6972.08333333

Coefficients Standard Error t Stat P-value Lower 95%


Intercept 4.722037523 2.4540671017 1.92416806 0.056553 -0.133753515
X Variable 1 0.0712335161 0.0142393385 5.00258603 0.00 0.043058552
X Variable 2 9.6871222064 3.585395381 2.70182816 0.007831 2.5928048809
X Variable 3 0.1225560315 0.9089562116 0.13483161 0.892957 -1.675969128

Number of Analysts = 4.72 + 0.07 x MVE + 9.69 x Institutions + 0.12 x D/E

(3) Using Linest


Formula: =LINEST(e5:e136,b5:d136,,TRUE). The blank prior to TRUE implies that the default (intercept not zero) is to be used
TRUE indicates that compute the entire statistics.

X Variable 3 X Variable 2 X Variable 1 Intercept


Slope --> 0.1225560315 9.69 0.07 4.72
Standard error of slope --> 0.9089562116 3.59 0.01 2.45
R2 --> 0.1895298518 6.64 #N/A #N/A
F statistic --> 9.9776741052 128.00 #N/A #N/A
med product of observations from means) --> 1321.417921 5650.67 #N/A #N/A
and firm size, % institutional ownership in the firm, and leverage.

MVE = Market value of equity of a firm in $ billions


Institutions = % insitutional shareholdings in a firm
DtoE = Debt to Equity ratio
Analysts = Number of analysts following a firm
(All data are for 2001)
Upper 95% Lower 95.0%Upper 95.0%
9.57782856 -0.13375351 9.577829
0.09940848 0.04305855 0.099408
16.7814395 2.59280488 16.78144
1.92108119 -1.67596913 1.921081

t (intercept not zero) is to be used.


Example 33.6 (from textbook): Multiple Regression - Predicted v. Actual
We first want to estimate the linear regression model between Y and X 1 and X2.
Then we want to plot the predicted values of Y based on this model for the following observations against the actual values of

Observation X1 X2 Y Predicted Y
1 35.3 81.2 10.98 11.4071 #VALUE!
2 29.7 22.5 11.13 11.4394
3 30.8 77.3 12.51 11.8166
4 58.8 34.8 8.4 8.6770
5 61.4 55.1 9.27 8.6004
6 71.3 124.8 8.73 8.2413
7 74.4 18.5 6.36 6.9932
8 76.7 234.6 8.5 8.6817
9 70.7 22.5 7.82 7.3937
10 57.5 123.3 9.14 9.5897

X2 X1 Intercept
0.008864 -0.098674 14.17054
0.002995 0.011037 0.627107
0.919582 0.578275 #N/A
40.02283 7 #N/A
26.76743 2.340814 #N/A
ions against the actual values of Y.

Chart Title
14.0000

12.0000

10.0000

8.0000

6.0000

4.0000

2.0000

0.0000
6 7 8 9 10 11 12 13
1 12 13
Example 33.7: Using VLOOKUP function
You are given a grading scheme. You are also given the scores earned by students. Use VLOOKUP to determine student grad

Grading Scheme Student Score Grade


Ashley 81 B
Score Grade John 64 D
0 F Mark 59 F
60 D Tim 92 A
70 C Jose 83 B
80 B Jason 77 C
90 A Laura 80 B

In the above example, we were not looking for an exact match of the score.
In such a case, the source table (grading scheme) has to be sorted in ascending order (by score).
to determine student grades.
Example 33.8: Using VLOOKUP function when an exact match is required
An investment advisory firm has prepared a report on 5 stocks. The report includes the ticker, classification into foreign or dom
over the next year. Your portfolio has 8 stocks. Use VLOOKUP to extract information for these stocks.

Investment Advisory Firm's Report Stocks in your portfolio

Ticker Company Foreign Forecast Ticker Company

GM General Motors No 5% TXN ---


SLB Schlumberger Yes 7% TXRH ---
INFY Infosys Yes 8% GOOG Google
GOOG Google No 3% T ---
AAPL Apple No 10% AAPL Apple
TGT ---
GM General Motors
INFY Infosys
classification into foreign or domestic stock, and expected return

Foreign Forecast

--- ---
--- ---
No 3%
--- ---
No 10%
--- ---
No 5%
Yes 8%

You might also like