Title | Graphically Displaying Data |
---|---|
Course | Economics 101 |
Institution | University of California Davis |
Pages | 18 |
File Size | 1.4 MB |
File Type | |
Total Downloads | 69 |
Total Views | 138 |
Download Graphically Displaying Data PDF
1
I.SourcesforDataandArticles ResourcesforEconomistsontheInternet (http://rfe.org) EconLit (fromtheUniversityLibrarywebpage, chooseArticles/ElectronicDatabasesA‐Z) NationalBureauofEconomicResearchWorking Papers(availableforfreethroughLibrary,under “ElectronicJournals”) ResearchPapersinEconomics(RePEc), (http://repec.org/) FRED(https://fred.stlouisfed.org/) (c)MarkV.Siegler(Donotciteorcirculate)
2
1
II.PropertiesofGoodGraphs
InformationallyRich,ButNotCluttered ClearandSelf‐Contained AestheticallyPleasing FitsinwiththeSurroundingText AvoidsGridlines,Legends,PoorColorSchemes,etc. LooksGoodinBothColorandBlackandWhite Avoids3‐D UsesRatioScaling(WheneverPossible)and ReasonableScalingandUnitsofMeasurementon theAxes (c)MarkV.Siegler(Donotciteorcirculate)
3
SomeBadGraphs...
(c)MarkV.Siegler(Donotciteorcirculate)
4
2
(c)MarkV.Siegler(Donotciteorcirculate)
5
AnotherBadGraph The CaliforniaAggie,May24,2011
(c)MarkV.Siegler(Donotciteorcirculate)
6
3
Morefrom The CaliforniaAggie,May26,2012
(c)MarkV.Siegler(Donotciteorcirculate)
7
BadPieChart (SharesShouldAlwaysSumto100Percent)
(c)MarkV.Siegler(Donotciteorcirculate)
8
4
TerriblePieCharts
(c)MarkV.Siegler(Donotciteorcirculate)
9
TerriblePieCharts
(c)MarkV.Siegler(Donotciteorcirculate)
10
5
SomeBetterExamples...
(c)MarkV.Siegler(Donotciteorcirculate)
11
Americans' Views on Immigration
Present Level 39%
Don't Know/No Opinion 4%
Increased 28%
Decreased 29% Should immigration be kept at its present level, increased, or decreased? Gallup Poll, June 21, 2018.
(c)MarkV.Siegler(Donotciteorcirculate)
12
6
20 10 0
Percent
30
40
Americans' View of Immigration
Remain the Same Increased Decreased Don't Know/No Opinion Should immigation be increased, decreased, or remain the same? (c)MarkV.Siegler(Donotciteorcirculate)
13
(c)MarkV.Siegler(Donotciteorcirculate)
14
7
(c)MarkV.Siegler(Donotciteorcirculate)
15
16
8
Figure7.7 TotalFertilityRatesintheUnitedStates 1800to2010 9 Black
NumberofChildrenperWoman
8 7
White
6 5 4 Hispanic
3 2
Asian
1 0 1800
1820
1840
1860
1880
1900
1920
1940
1960
1980
2000
(c)MarkV.Siegler(Donotciteorcirculate)
17
(c)MarkV.Siegler(Donotciteorcirculate)
18
9
WorldPopulation,1750to2000 LinearScaling 7000
6000
MillionsofPeople
5000
4000
3000
2000 1000
0 1750
1800
1850
1900
1950
2000
(c)MarkV.Siegler(Donotciteorcirculate)
19
WorldPopulation,1750to2000 RatioScaling 10000
MillionsofPeople
1000
100
10
1 1750
1800
1850
1900
(c)MarkV.Siegler(Donotciteorcirculate)
1950
2000
20
10
DifferentScalingCanLeadto (Radically)DifferentInterpretations
(c)MarkV.Siegler(Donotciteorcirculate)
21
(c)MarkV.Siegler(Donotciteorcirculate)
22
11
(c)MarkV.Siegler(Donotciteorcirculate)
23
III.TypesofGraphsinR PieCharts:pie() BarandColumnCharts:barplot() BoxandWhiskerPlots:boxplot() Histograms:hist() (Time‐Series)LineGraphs:plot().Toputthe datesonthehorizontalaxis,useats object ScatterDiagram:plot(x,y)
See Quick-R graphs at: https://www.statmethods.net/graphs/index.html (c)MarkV.Siegler(Donotciteorcirculate)
24
12
IV.ParametersforGraphsinR main, xlab, ylab (Graphtitle,x‐axislabel,y‐
axislabel) lwd, lty (linewidthandlinetype,lwd = 3,for exampleleadstoathickerlinethatlwd = 2) xlim, ylim (providesthelimitsforthehorizontal axisrangeandtheverticalaxisrange,respectively) col (colororcolorstobeusedingraph).Forallthe colorsRsupports,see http://www.stat.columbia.edu/~tzheng/files/Rcolor.pdf
font.lab (fontsforthelabels) font (fontselsewhereingraph) (c)MarkV.Siegler(Donotciteorcirculate)
25
IV.ParametersforGraphsinR breaks()providesintervalsforthevariablewhen
constructingafrequencydistribution(histogram). Withbreaks=c(2, 4, 6, 8),itwouldinclude thefrequencyofobservationsbelowandincluding2 inthefirstinterval,thoseabove2andincluding4in thesecondinterval,andsoon.
(c)MarkV.Siegler(Donotciteorcirculate)
26
13
V.AddingPoints,Lines,andTexttoGraphs points (addspoints) lines, abline, segments (addslinesto
graph) text (writestext) arrows (addsarrows) legend (addslegend). Avoidusinglegends wheneverpossible.
(c)MarkV.Siegler(Donotciteorcirculate)
27
VI.ExampleofanRScriptforaPieChart x = c(1, 1, 1, 2, 2, 3, 4, 4, 4, 4) pie(table(x), main = "Distribution of Course Grades", labels=c("D grade (30%)", "C grade (20%)", "B grade (10%)", "A grade (40%)"), col = c("dark blue", "blue", "light blue", "white"))
(c)MarkV.Siegler(Donotciteorcirculate)
28
14
Distribution of Course Grades
D grade (30%) C grade (20%)
B grade (10%)
A grade (40%)
(c)MarkV.Siegler(Donotciteorcirculate)
29
VII.ExampleofanRScriptforaHistogram absent = c(1, 1, 2, 4) hist(absent, breaks = c(0.5, 1.5, 2.5, 3.5, 4.5), col="blue", main = "Frequency Distribution of Days Absent", freq=FALSE, ylim = c(0, 0.50), xlab = "Number of Days Absent")
(c)MarkV.Siegler(Donotciteorcirculate)
30
15
0.3 0.2 0.0
0.1
Density
0.4
0.5
Frequency Distribution of Days Absent
1
2
3
4
Number of Days Absent (c)MarkV.Siegler(Donotciteorcirculate)
31
VIII.AdvancedGraphics WhilethebaseinstallationofRcontainsmanyways
tographdata,advancedusersmaywanttoconsider usingthepackagesggplot2 and/orlattice. ggplot2,forexample,allowsyoutomakespatial maps. Therearemany,manypackagesyoucaninstallto creategraphswithR,but,foreconomists,simplicity andclarityarekey.
(c)MarkV.Siegler(Donotciteorcirculate)
32
16
InClimbingIncomeLadder,LocationMatters Theoddsofrisingtoanotherincomelevelarenotablylowincertaincities,like AtlantaandCharlotte,andhigherinNewYork,Boston,andSanFrancisco.
©MarkV.Siegler(Donotciteorcirculate)
33
IX.AFewWordsAboutPowerPoint Followthe“8by10”Rule Nomorethaneightlinesperslide(excludingtitle) Nomorethantenwordsperline Donotshowonelineatatimeonaslide (Thisisreallyannoyingtoyouraudience) Avoidanimations,particularlyridiculousones. FollowtheTwo‐FontRule Nomorethantwofontsperpresentation (c)MarkV.Siegler(Donotciteorcirculate)
34
17
IX.AFewWordsAboutPowerPoint ThePowerPointsareNOTthePresentation Yourwordsandactionsarethepresentation PowerPointcanhelp(insmalldoses) PowerPointshouldn’tdominate Oneslideeverytwoorthreeminutesatthe
maximum Don’tjustreadyourslides!!!
(c)MarkV.Siegler(Donotciteorcirculate)
35
18...