CENTER FOR FAMILY & DEMOGRAPHIC RESEARCH
Making Graphs with Excel Summer 2014 Workshop Series
CHARTS?
WHY-
Picture Superiority Effect Information is better remembered in tests of recall and item recognition when presented as pictures rather than words
Fruit <
SOCIOLOGISTS?
Why is it so difficult for-
How do you process? • Analytical
• Logical
• Precise
• Repetitive
• Organized
• Details
• Scientific
• Detached
• Literal
• Sequential
• Creative
• Imaginative
• General
• Intuitive
• Conceptual
• Big picture
• Heuristic
• Empathetic
• Figurative
• Irregular
I Propose we Marry the Two The pun is intended!
Organization of Presentation
• Structure of an Excel Chart
• Different Types of Excel Charts
• Basic Principles of Chart Design
• Graphing Interaction Effects
• Creating a Chart with a Double Axis
THE STRUCTURE OF AN EXCEL CHART?
What makes up-
Let’s Dissect…
36.0
24.2
05
101520253035404550
$0 $5 $10 $15 $20 $25 $30 $35 $40
Rate
s per
1,0
00 a
t Ris
k Po
pula
tion
HMI Spending Per Population at Risk of Marriage or Divorce
Predicted Marriage & Divorce Rates Upper Bounds (UB) & Lower Bounds (LB)
UB Mar Rt LB UB Div Rt LB
Chart Title
Legend
Axis Titles
Axis
Gridlines
Data Labels
Sources: U.S. Census Bureau, American Community Survey, 2008-2011; HMI spending data– Hawkins et al., 2013. Source
THE DIFFERENT TYPES OF CHARTS?
What are-
Histograms A vertical bar chart that depicts the distribution of a set of data
Histograms, example
Pie Charts Generally used to show percentage or proportional data classified into nominal or ordinal categories
Pie Charts, examples Simple Pie Pie-of-Pie
Childcare 15%
School/ Training
20%
Layoff 19%
Other 46%
Top Reasons for Fathers Leaving the Workforce in 2008
Single 18%
Cohabiting 25%
Married 57% Unmarried
43%
Percent of births by informal marital status of mother, 2005-
2010
Source: Survey of Income and Program Participation, 2008 March Supplement
Source: NSFG 2006-2010
Pie Charts, examples Simple Pie Doughnut
Didn't enroll 40%
No degree 33%
Associate's degree
6%
Bachelor's degree
21%
College experiences of young adults (by age 25)
Did not finish 44%
Associate's degree
7%
Bachelor's degree
49%
Percent of young adults who enroll in a 4-year program by
degree earned by age 25
Source: National Longitudinal Survey of Youth 1997, Rounds 1-13: 1997-2009 weighted. U.S. Department of Labor, Bureau of Labor Statistics, NCFMR analyses of valid cases.
Bar Chart, example
19%
20%
12%
8%
2%
33%
13%
7%
9%
11%
None
GED
H.S.
Assoc. Deg.
B.A.+
Blacks
Hispanics
Whites
Men
Women
Pre-
unio
n Fi
rst B
irth
Prevalence of Pre-union First Birth across Demographic Characteristics
Yes 33%
No 67%
Blacks
Yes 13%
No 87%
Hispanics
Yes 7%
No 93%
Prevalence of Pre-union First Birth by Race/Ethnicity: Whites
Source: National Longitudinal Survey of Youth 1997 (NLSY97), Rounds 1-13: 1997-2009 (weighted). U.S. Department of Labor, Bureau of Labor Statistics, NCFMR analyses of valid cases.
Column & Bar Charts Useful for showing data changes over a period of time or for illustrating comparisons among items
Column Charts, examples Simple
74% 80%
49%
62%
70%
All fathers White Black NB Hispanic FB Hispanic
Fathers Living with All of Their Children Race, Ethnicity & Nativity
Side-by-Side
11%
25% 20% 22%
25%
44% 38% 37%
0%
10%
20%
30%
40%
50%
60%
70%
80%
White Black Asian Hispanic
Percentage of Same-Sex Couple Households with Minor Children by Sex of Couple and Race/Ethnicity of Household
Head
Male-Male Female-Female
Source: NSFG 2006-2010 Source: U.S. Census Bureau, American Community Survey, 1-Year Estimates, 2012
Column Charts, examples
-25%
-18%
-12%
-8%
16%
Percent Change in Share of Aggregate Income from 1970-2009
Lowest fifth Second fifth Third fifth Fourth fifth Highest fifth
Source: U.S. Census Bureau, Current Population Survey, Annual Social and Economic Supplements
Column Charts, examples
55% 65%
31%
52% 53%
76%
6% 11%
1% 6%
11% 19%
Married CoupleHouseholds
Different SexCouples
MaleSame SexCouples
FemaleSame SexCouples
FatherOnly
MotherOnly
Cohabiting Households Single Parent Households
Public Assistance Participation among U.S. Children in Poverty by Family Structure, 2010
SNAP TANF
Source: U.S. Census Bureau, American Community Survey, 1-Year Estimates, 2010
Column Charts, examples
15% 16% 17% 18%
6% 11%
18% 24% 21%
27% 35%
42%
0%
20%
40%
60%
80%
100%
1980-1984 1990-1994 1997-2001 2005-2009
Changes in the Shares of Births to Single and Cohabiting Mothers Under Age 40
Single Cohabiting Total Non-Marital
Sources: 1980-1984 data, Bumpass & Lu (2000) using NSFH, 1987/1988; 1990-1994 & 1997-2001 data, Kennedy & Bumpass (2008) using NSFG 1995 & NSFG 2002; 2005-2009, NCFMR analyses using NSFG 2006-2010.
Line Charts Ideal for showing trends over time
Line Charts, examples
4.4
30.9
2.4
20.4 22.1
57.1
0
10
20
30
40
50
60
70
1955-59 1960-64 1965-69 1970-74 1975-79 1980-84 1985-89 1990-94 1995-99 2000-04 2005-09
Share of Married Mothers Experiencing a Premarital Birth, by Race and Marriage Cohort
Overall
White
Black
Source: The Integrated Fertility Survey Series (IFSS) is a project of the Population Studies Center and the Inter-university Consortium for Political and Social Research at the University of Michigan, with funding from the Eunice Kennedy Shriver National Institute of Child Health and Human Development (NICHD, grant 5R01 HD053533; Pamela J. Smock, PI).
Line Charts, examples
67%
42%
51%
51%
32%
47%
24%
10%
19%
17%
7% 15%
0%
20%
40%
60%
80%
100%
1940 1950 1960 1970 1980 1990 2000 2010
Young Adults Living in a Parent's Household and Economic Recession Years by Sex and Ages, 1940-2010
Recessions
18-24 Men
18-24 Women
25-34 Men
25-34 Women
2 per. Mov. Avg.(18-24 Women )2 per. Mov. Avg.(25-34 Men)
gf
Source: U.S. Census Bureau, Decennial Census, 1940-2000 (IPUMS); U.S. Census Bureau, American Community Survey, 1-year estimates 2010 (IPUMS)
Line Charts, examples
46.1
33.9
18.4 18.4
$5
$122
$0
$20
$40
$60
$80
$100
$120
$140
$160
0
5
10
15
20
25
30
35
40
45
50
2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010
Dolla
r Am
ount
s in
Mill
iom
s
Rate
s per
1,0
00 a
t Ris
k
Annual HMI Spending and Marriage & Divorce Rates, 2000 - 2010 Marriage Rate Divorce Rate HMI Spending
Sources: CDC/NCHS, National Vital Statistics System, 2000; Glass & Levchak, 2010, NCFMR County-Level Marriage & Divorce Data, 2000; U.S. Census Bureau, Decennial Census, 2000; U.S. Census Bureau, American Community Survey, 1-Year Estimates, 2008 – 2010; HMI Spending data – Hawkins et al., 2013.
Line Charts, examples
0
10
20
30
40
50
60
70
80
90
100
20
21
22
23
24
25
26
27
28
1980
1982
1984
1986
1988
1990
1992
1994
1996
1998
2000
2002
2004
2006
2008
2010
Perc
ent
Age
in y
ears
Crossover in median age at first marriage and first birth: Rising proportion of births to unmarried women, 1980-Present
Proportion of births to unmarried womenWomen's median age at first marriageWomen's median age at first birth
Sources: 1. U.S. Census Bureau, Current Population Survey, March and Annual Social and Economic Supplements, 2012 and earlier. 2. Centers for Disease Control and Prevention. National Center for Health Statistics. Vital Stats. http://www.cdc.gov/nchs/vitalstats.htm. [March 2013]. 3. Martin JA, Hamilton BE, Ventura SJ, et al. Births: Final data for 2009. National vital statistics reports; vol 60 no 1. Hyattsville, MD: National Center for Health Statistics.
2011. 4. Hamilton BE, Martin JA, Ventura SJ. Births: Preliminary data for 2010. National vital statistics reports web release; vol 60 no 2. Hyattsville, MD: National Center for
Health Statistics. 2011.
Scatter Plots Commonly used to show the relationship between two variables e.g. correlation
Scatter Plots, example
AL
AZ
AR CA
CO
CT
DE
DC
FL GA HI
ID IN
IA
KY
LA
ME
MD
MA MI
MN
MS
MO
NE NH
NJ
NM
NY NC
ND
OH OK
PA
RI
SC TN
TX
UT
VA
WV
WI
WY
230
240
250
260
270
280
290
0 5 10 15 20 25 30
1992
Sta
te 8
th-g
rade
NAE
P M
ath
Scor
e
% Students watching TV 6 hrs+ per day
State Math Scores and Students' TV Viewing Habits
Source: National Center for Educational Statistics, 1994
Area Charts Show percentage or proportional data classified into nominal or ordinal categories over time
Area Charts, example
0%
20%
40%
60%
80%
100%
1970 1980 1990 2000 2008 2012
Marital Status of U.S. Population Aged 15 and Older, 1970-2012
Married
Never Married
Divorced
Widowed
Source: 1970-2000 data, U.S. Census Bureau, Current Population Survey, March and Annual Social and Economic Supplements. 2008 and 2012 data, U.S. Census Bureau, American Community Survey, (IPUMS)
BASIC PRINCIPLES OF CHART DESIGN?
What are some-
1. Simplify • Minimize ink-to-data ratio • Remove unneeded chart
elements – Gridlines – Chart borders – Axis titles – Legends – Markers & data labels – Decimal points (in axis &
data labels) – Trend lines – NO 3D charts!!!!!!!!!!!!!!!!!!!
• Sort data in a meaningful way
Example of a 3D Chart:
Allfathers
White Black NBHispanic
FBHispanic
74% 80%
49%
62% 70%
Fathers Living with All of Their Children Race, Ethnicity & Nativity
2. Color vs. Black & White
• When in doubt black & white
• Color can help tell a story
• Color = branding (e.g. CFDR, NCFMR, BGSU) – Use a cohesive and consistent color palette
– Be mindful of how audience will view • Excel vs. Word vs. PDF
• Color vs. B&W print copy
3. Do NOT Use Distorted Charts
• Do NOT misrepresent your data!
• Use appropriate and consistent axis and scales
4. Present Related Charts Simultaneously • One-after-another or side-by-side if
possible
• Emphasizes importance of appropriate axis and scales
5. Know Your Audience
• Academics vs. lay folks
• Undergraduate students vs. graduate students
• Graduate students vs. professors
• PAA presentation vs. job talk
6. TMC = TMI
• Too many charts (TMC) is as bad as too much information (TMI) Do NOT overload your audience!
Let’s apply some principles: Which is easier to understand?
35.97
24.25
05
101520253035404550
$0.00 $10.00 $20.00 $30.00 $40.00Rate
s per
1,0
00 a
t Ris
k Po
pula
tion
HMI Spending Per Population at Risk of Marriage or Divorce
Predicted Marriage & Divorce Rates Upper Bounds (UB) & Lower Bounds (LB)
UB Mar Rt LB
UB Div Rt LB
39 36
19
24***
0
5
10
15
20
25
30
35
40
45
$0 $8 $16 $24 $32
Predicted Marriage & Divorce Rates Given State-level HMI Spending
Mar Rt Div Rt
Sources: U.S. Census Bureau, American Community Survey, 2008-2011; HMI spending data– Hawkins et al., 2013.
7. Do you need a chart?
$117 mill
ion The amount annual
HMI spending in the U.S. increased from 2000 – 2010
Sources: U.S. Census Bureau, American Community Survey, 2008-2011; HMI spending data– Hawkins et al., 2013.
CHART INTERACTION EFFECTS?
How do I-
Logistic Regression Predicting Ever Marrying • An interaction between a categorical and
continuous predictor (DeMaris 2004, p 143):
E(Y) = β0 + δ1Black + β1Parity + ϒ1Black*Parity – The subpop consists of only White and Black women
– Black is a dummy variable
– Parity indicates number of live births, range 0-15
– Analyses is weighted
Logistic Regression Predicting Ever Marrying, cont. • Stata Output for Full Model: . svy, subpop(blkwht): logistic evermar black PARITY PARITYblk, coef (running logistic on estimation sample) Survey: Logistic regression Number of strata = 56 Number of obs = 12279 Number of PSUs = 152 Population size = 61754741 Subpop. no. of obs = 8568 Subpop. size = 45835139 Design df = 96 F( 3, 94) = 186.25 Prob > F = 0.0000 ------------------------------------------------------------------------------ | Linearized evermar | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- black | -.4698438 .1172022 -4.01 0.000 -.7024885 -.2371992 PARITY | 1.458909 .0707637 20.62 0.000 1.318444 1.599374 PARITYblk | -.9253343 .0978554 -9.46 0.000 -1.119576 -.7310928 _cons | -.8652098 .0616793 -14.03 0.000 -.9876423 -.7427772 ------------------------------------------------------------------------------
Logistic Regression Predicting Ever Marrying, cont. • Table of Results
Logistic Regression Predicting Ever Marrying Model 1
(Zero-Order) Model 2 Model 3
(Full)
Coef. SE Coef. SE Coef. SE Black -0.854 0.325 *** -1.589 0.113 *** -0.470 0.117 *** Parity 1.040 0.054 *** 1.150 0.053 *** 1.459 0.071 *** Black X Parity -0.925 0.098 *** Constant -0.679 0.06 *** -0.865 0.062 ***
• Equation for Full Model E(Y) = β0 + δ1Black + β1Parity + ϒ1Black*Parity
• Equation for Black Women E(Y) = β0 + δ1 + β1Parity + ϒ1*Parity
• Equation for White Women E(Y) = β0 + β1Parity
• Now, Plug and Play in Excel!
Logistic Regression Predicting Ever Marrying, cont.
Logistic Regression Predicting Ever Marrying, cont. Unformatted Formatted
-5.000
0.000
5.000
10.000
15.000
20.000
25.000
1 2 3 4 5 6 7 8 9 10111213141516
Black Women
White Women
-10
-5
0
5
10
15
20
25
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Parity
Effect of Parity on Ever Marrying for Black and White Women
Black Women White Women