Model Regress Linear 3Factor Excel 2013 V0F 1 by Milo Schield Member: International Statistical...

Post on 17-Jan-2016

215 views 1 download

transcript

Model Regress Linear 3Factor Excel 2013V0F 1

byMilo Schield

Member: International Statistical Institute

US Rep: International Statistical Literacy Project

Director, W. M. Keck Statistical Literacy Project

Slides at: www.StatLit.org/pdf

/Model-Regress-Linear-3Factor-Excel2013-6up.pdf/Model-Regress-Linear-3Factor-Excel2013-1up.pdf

Model using RegressLinear 3Factor in Excel 2013

Model Regress Linear 3Factor Excel 2013V0F 2

Goal: Summarize association before/after control for Gender

Required output: Create and upload your worksheet*:

1. Generate two charts (slides 4 and 15). Slide 4: Show trend-line, equation and R2.

Slide 15: Show trend-lines. Show regression model.

2. Generate/show averages (slide 3) .

3. Generate/show output from regression (slide 9). Data: www.StatLit.org/xls/Pulse-Regress-Worksheet.xlsxNote: Male is already in column D in this worksheet. Demo output: www.StatLit.org/pdf/Pulse-Regress-Output.pdf

Subjects are college students. Male: 1 for men; 0 for women.

Model Regress Linear 3Factor Excel 2013V0F 3

Analyze Data:Enter Formula into K3:L4

Actual male-female differences:• Average weight: 158.3 - 123.8 = 34.5 pounds• Average height: 70.75 – 65.40 = 5.35 inches

Question: How much of the male-female weight difference (34.5#) is due to gender (male vs. female) and how much is due to the difference in heights?

Analyzing a whole into parts is called “decomposition”.

Model Regress Linear 3Factor Excel 2013V0F 4

Chart #1

.

y = 5.0918x - 204.74R2 = 0.616

90

115

140

165

190

215

60 65 70 75

We

igh

t

Height

Weight vs Height

Model Regress Linear 3Factor Excel 2013V0F 5

Decompose Male-Female Weight Difference: 1st try

Actual male-female differences (slide 3):• Average weight: 158.3 - 123.8 = 34.5 pounds• Average height: 70.75 – 65.40 = 5.35 inches

Model Weight on Height (slide 4)• Expected Weight = -204.74 + 5.09 * Height

Decomposition of male-female weight difference: • Due to Height difference: 5.09*5.35 = 27.23#• Due to Sex (Gender) difference: 34.5# – 27.2# = 7.3#Inadequate!!! Sex and height are confounded in slope.

Model Regress Linear 3Factor Excel 2013V0F 6

Model Weight by Height & Sex:Four Step Process

Step 1. From Data Toolbar, select Data Analysis (in the Analysis section). Select Regression

Step 2. Regress Weight on Height and Gender

Step 3. Generate Y values given X for models

Step 4. Generate two trend lines on XY plot

Model Regress Linear 3Factor Excel 2013V0F 7

1) Data Toolbar, select Data Analysis. Select Regression

.

Model Regress Linear 3Factor Excel 2013V0F 8

2a) Regress Weight on Height and Sex

.

Model Regress Linear 3Factor Excel 2013V0F

Weight = -117.6 + (3.69*Height) + (14.7*Male).

9

2b) Results: Regress Weight on Height and Sex (Male?)

Formatting and formula are optional

Model Regress Linear 3Factor Excel 2013V0F 10

3) Expected Weights at selected Heights for Men and Women

Create formula in L33 predicting weight:

Pull L33 down

Model Regress Linear 3Factor Excel 2013V0F 11

4a) Start with new chart:Select Data; Select “Add”

.

Model Regress Linear 3Factor Excel 2013V0F 12

4b) Add Two New Series

.

Model Regress Linear 3Factor Excel 2013V0F 13

4c) After Adding Two New Series,Press “OK”

.

Model Regress Linear 3Factor Excel 2013V0F 14

4d) Select Data Point. Format Data Series. Select ‘Solid Line’

.

90

115

140

165

190

215

60 65 70 75

We

igh

t

Height

Weight vs Height

Model Regress Linear 3Factor Excel 2013V0F 15

4e) Add Regression Equation. Final Result

.

90

115

140

165

190

215

60 65 70 75

We

igh

t

Height

Weight vs Height

Weight = -117.6 + 3.69*Height + 14.7*Male

Male

Female

Model Regress Linear 3Factor Excel 2013V0F 16

Decompose Male-Female Weight Difference: 2nd try

Multivariate ‘regression’ model (slide 9 or 15):Weight = -117 + (3.7*Height) + (14.7*Male)

Difference in average heights: 5.35” (slide 3)Difference in average weights: 34.5# (slide 3)

•14.7 pounds due to gender difference – after controlling for height.

•19.8 pounds due to height difference – after controlling for gender: 3.7 #/inch * 5.35 inches

Moral: How you take things into account matters!

Model Regress Linear 3Factor Excel 2013V0F 17

Decompose Male-Female Weight Difference: Summary

Decompose 34.5# male-female weight difference.

1st try: Regress weight on height (R2 = .62)•27.2 pounds due to height difference• 7.3 pounds due to gender differenceProblem: Gender, height and weight are confounded

2nd try: Regress weight on height and sex (R2 = .66)•19.8# due to height – after controlling for gender•14.7# due to gender – after controlling for height

Moral: How you take things into account matters!