A radical view on plots in analysis

25
A radical view on plots in analysis Hein Stigum Presentation, data and programs at: http://folk.uio.no/heins/

description

A radical view on plots in analysis. Hein Stigum Presentation, data and programs at: http://folk.uio.no/heins/. Agenda. Why use graphs Common use A graphic evolution Plots in analysis. Why use graphs?. Problem example. Lunch meals per week Table of means (around 5 per week) - PowerPoint PPT Presentation

Transcript of A radical view on plots in analysis

Page 1: A radical view  on plots  in analysis

A radical view

on plots in analysis

Hein Stigum

Presentation, data and programs at:

http://folk.uio.no/heins/

Page 2: A radical view  on plots  in analysis

Agenda

• Why use graphs

• Common use

• A graphic evolution

• Plots in analysis

04/22/23 H.S. 2

Page 3: A radical view  on plots  in analysis

Why use graphs?

Page 4: A radical view  on plots  in analysis

04/22/23 H.S. 4

Problem example• Lunch meals per week

– Table of means (around 5 per week)

– Linear regression0

1020

3040

50P

erce

nt

1 2 3 4 5 6 7Lunch meals per week

Page 5: A radical view  on plots  in analysis

04/22/23 H.S. 5

Problem example 2• Iron level

– Linear regression: Males 9.4 units higher iron level

– Logistic regression: Males 10.4 times more anemia

125115

Ma

le m

ea

n

Fe

ma

le m

ea

n

50 cutoff 90 150 190Iron level

Iron level by sex

Page 6: A radical view  on plots  in analysis

04/22/23 H.S. 6

Problem example 3

• Weight on blood pressure

_cons 10.944734 -28.388124 Males 9.67202 weight10 15.632724 20.618903 Variable Crude Adjusted

Adjusted 199 -1011.745 -963.3133 3 1932.627 1942.507 Crude 200 -1018.258 -993.7326 2 1991.465 1998.062 Model Obs ll(null) ll(model) df AIC BIC

5010

015

020

025

0B

lood

pre

ssur

e

50 100 150weight

Missing sex

Page 7: A radical view  on plots  in analysis

Common use

Page 8: A radical view  on plots  in analysis

Pie and bar

04/22/23 H.S. 8

Measure 1

Measure 2

Measure 3

01

23

mean of v1 mean of v2 mean of v3

Page 9: A radical view  on plots  in analysis

Bar-Dot-Line evolution

04/22/23 H.S. 9

01

23

4

0 1 2 3+

mean of v1 mean of v2 mean of v3

01

23

4

0 1 2 3+Parity

(mean) v1 (mean) v2 (mean) v3

01

23

4

0 1 2 3+Parity

(mean) v1 (mean) v2 (mean) v3

Page 10: A radical view  on plots  in analysis

The workhorses:Scatter and density

Page 11: A radical view  on plots  in analysis

Scatterplot10

0020

0030

0040

0050

00B

irth

wei

ght

250 260 270 280 290 300 310Gestational age

1000

2000

3000

4000

5000

Birt

h w

eigh

t

250 260 270 280 290 300 310Gestational age

1000

2000

3000

4000

5000

Birt

h w

eigh

t

250 260 270 280 290 300 310Gestational age

Page 12: A radical view  on plots  in analysis

04/22/23 H.S. 12

Density

• Density– kdensity weight

• Boxplot– graph hbox weight

0 2000 4000 6000weight

0 2,000 4,000 6,000weight

Page 13: A radical view  on plots  in analysis

04/22/23 H.S. 13

Density with “boxplot” information

min w 25% 50% 75% w max

200 3180 3940 53502040 3600 5080

WeightN=583

Page 14: A radical view  on plots  in analysis

04/22/23 H.S. 14

Scatter and density plots for many types of data

Y-type X-type Scatter DensityCont xCont Cont xCont Cat x x

Binary Cont x

x-normal usex-suggested use

Page 15: A radical view  on plots  in analysis

Plots in analysis

Page 16: A radical view  on plots  in analysis

Continuous outcome

Page 17: A radical view  on plots  in analysis

04/22/23 H.S. 17

Continuous by 1 category

min w 25% 50% 75% w max

200 3180 3940 53502040 3600 5080

WeightN=583

Page 18: A radical view  on plots  in analysis

Continuous by 2 categories20

0030

0040

0050

0060

00B

irth

wei

ght

Boy Girlsex

• Is birth weight the same for boys and girls?

Scatterplot Density plot

2000 3000 4000 5000 6000Birth weight

Equal means? Linear effect?Outliers?

Equal variances?

Page 19: A radical view  on plots  in analysis

04/22/23 H.S. 19

Continuous by 3 categories

• Is birth weight the same over parity?

Scatterplot Density plot

2000

3000

4000

5000

6000

Birt

h w

eigh

t

0 1 2-7Parity

2000 3000 4000 5000 6000Birth weight, g

012+

Equal means? Linear effect?Outliers?

Equal variances?

Page 20: A radical view  on plots  in analysis

04/22/23 H.S. 20

Continuous by continuous

• Does birth weight depend on gestational age?Scatterplot Density plot

Equal means? Linear effect?Outliers?

1000

2000

3000

4000

5000

Birt

h w

eigh

t

250 260 270 280 290 300 310Gestational age

Page 21: A radical view  on plots  in analysis

Binary outcome

Page 22: A radical view  on plots  in analysis

Binary by 2 categories

• Does the low birth weight depend on sex?0

.2.4

.6.8

1L

ow b

irth

we

ight

Boy Girlsex

0.2

.4.6

.81

Low

birt

h w

eig

ht

Boy Girlsex

0.2

.4.6

.81

Boy Girlsex

Jitterandline

Page 23: A radical view  on plots  in analysis

Binary by 3 categories

• Does the low birth weight depend on parity?0

.2.4

.6.8

1

0 1 2+Parity

Page 24: A radical view  on plots  in analysis

Binary by 3 categories, no scatter

0.0

4.0

8.1

2P

ropo

rtio

n lo

w b

irth

wei

ght

0 1 2+Parity

• Does the low birth weight depend on parity?

Page 25: A radical view  on plots  in analysis

04/22/23 H.S. 25

Scatter: binary by countinuous

-.5

0.5

11

.5P

ropo

rtio

n lo

w b

irth

we

ight

100 150 200 250 300Gestational age

• Does the low birth weight depend on gest. age?