### Excel functions for Normal Distribution (1)

MGTSC 312: Lab 9
November 24, 2011 - Transformations
Announcements
• Hw 7 is due this Friday at 11:59 p.m.
DO NOT SUBMIT LATE!
• Hw 8 is due on December 6 at 11:59 p.m.
DO NOT SUBMIT LATE!
• Lab Exam 3 is next Thursday December 1
“Exams and Quizzes”
MGTSC 312: Lab 9 - Loglinear Model
2
Agenda
• Evaluation Survey
• Today’s lab relates to Topic 10
‒ GDP data
‒ Linear Model
‒ Loglinear Model
• Memo Formatting
MGTSC 312: Lab 9 - Loglinear Model
3
Look at the Data
• Canadian Gross Domestic Product (GDP)
‒ Quarterly from 1961Q1 to 1989Q4
•
•
•
•
Use the graph wizard to create a scattergraph
Does the graph look like a straight line?
Is there any repeating pattern?
Add a linear trendline and an exponential trendline
‒ The exponential looks like a much better fit
‒ The exponential corresponds to regressing the natural logarithm of GDP
on Time, which is what we’re about to do
MGTSC 312: Lab 9 - Loglinear Model
4
Transform the Data
• Let’s create a new dependent variable for a regression, the
natural log of GDP
• Use Excel’s =LN() function
• Create a line graph for LnGDP vs. year/quarter
• Does it look like a straight line?
• Change the y-axis scale to use all of the available space!
• We also need to change the time to just numbers, starting at 1
and counting by 1 to 116 (which is just Obs #)
MGTSC 312: Lab 9 - Loglinear Model
5
Regress GDP and lnGDP on Time
• Insert a new ‘Regress’ worksheet for the output
• Regress lnGDP the same way and put the output beside the
first
‒ R2 and Ftest are even larger, but the scale is different so R2 is not
comparable
MGTSC 312: Lab 9 - Loglinear Model
6
Find the Growth Factor and Rate
• The quarterly growth factor is EXP(b1) = 1.0268
• The annual growth factor is the quarterly growth factor to the
power of 4 = 1.1116
• The quarterly growth rate as a percent
‒ 100*(quarterly growth factor - 1) = 2.68%
• The annual growth rate as a percent
‒ 100*(annual growth factor - 1) = 11.16%
• On average GDP increased by about 11.16% per year from 1961
through 1989 – looks pretty large compared to the last year!
MGTSC 312: Lab 9 - Loglinear Model
7
Predicted GDP from Loglinear
• Copy the Predicted lnGDP from the loglinear regression and
paste to another sheet
• Calculate the predicted GDP as =EXP(predicted lnGDP)
• Beside that column, copy and paste the predicted GDP from
the linear model (Note the negative values!)
• Beside that column, copy and paste the actual GDP
MGTSC 312: Lab 9 - Loglinear Model
8
Predicted GDP and Actual
lnPredict exp(lnPred)[y^] actual
9.12
9164.8
9290
9.15
9.18
9.20
9.23
9.26
9.28
9.31
9.33
9.36
9.39
9.41
9.44
9.47
9.49
9.52
9.55
9.57
9.60
MGTSC 312: Lab 9 - Loglinear Model
9410.4
9662.7
9921.7
10187.7
10460.8
10741.2
11029.1
11324.7
11628.3
11940.0
12260.1
12588.7
12926.2
13272.6
13628.4
13993.8
14368.9
14754.0
10008
11148
10727
10053
10719
12396
11497
10714
11468
13270
12509
11938
12654
14395
13562
12928
13881
15889
9
Plot Both Predicted versus Actual
• Loglinear is a much better fit for the data
MGTSC 312: Lab 9 - Loglinear Model
10
• If there’s time, let’s see whether the quarter of the year makes a
difference
• Add quarter dummies with =IF() as we’ve done previously
• Regress lnGDP on Time and three quarter dummies
‒ Two of the quarter dummies have p-values < 0.01
• Perform a Partial F test
‒ p-value = 1.1E-7
‒ The quarter dummies improve the fit, so use all 3
MGTSC 312: Lab 9 - Loglinear Model
11
Regression Statistics
Time & Quarter
Multiple R
0.997
R Square
0.994
Square
0.994
Standard
Error
0.071
Observations
116
ANOVA
Regression
Residual
Total
Intercept
Time
Q1
Q2
Q3
df
4
111
115
SS
91.222
0.562
91.784
Coeff
9.103
0.026
-0.057
-0.021
0.060
Std Error
0.018
0.000
0.019
0.019
0.019
MGTSC 312: Lab 9 - Loglinear Model
MS
F
22.805 4501.506
0.005
t Stat
512.812
133.816
-3.044
-1.099
3.223
Reduced
df
SS
Regression
1
91.013
Partial F
SSR-SSR
dfR - dfR
Fnum
Fden
Ftest
dfDen
p-value
0.2092
3
0.0697
0.0051
13.7659
111
1.072E-07
P-value
3.8E-189
1.6E-124
0.002913
0.274192
0.001668
12
Memo Formatting
Memo Formatting
• The first part of the file tells you how to format the HW 8 file,
but doesn’t follow its own instructions
• Let’s make the file follow the rules
• There are often several ways to accomplish the same task in
• If the rulers are not visible go to View > Show/Hide > Ruler
and drag the margin markers
‒ Or go to Page Layout > Margins
• Home > Select > Select All
‒ Font Times New Roman 11 pt
‒ Paragraph > Spacing: Single, Before (or After) 6 pts, or 3 pts before and 3
pts after. Ensure the “Don’t Add Space…” box remains unchecked
• Grammar and Spell checking
‒ Office button > Word Options > Proofing
• Office button > Save As > Word ‘97 – 2003 document
MGTSC 312: Lab 9 – Loglinear Model
14