CHAPTER12. PRINCIPLESOFGRAPHCONSTRUCTION
113
– Canonlyshowone-sidedconfidenceintervalswell
– Thickbarsreducethenumberofcategoriesthatcanbeshown
– Labelsonverticalbarchartsaredifficulttoread
Dotplotsarealmostalwaysbetter
Considermulti-panelside-by-sidedisplaysforcomparingseveralcontrasting
orsimilarcases. Makesurethescalesinboth
x
and
y
axesarethesame
acrossdifferentpanels.
Considerorderingcategoriesbyvaluesrepresented,formoreaccurateper-
ception
12.9 DisplayingDistributionCharacteristics
Whenonlysummaryorrepresentativevaluesareshown,trytoshowtheir
confidenceboundsordistributionalproperties,e.g.,errorbarsforconfidence
boundsorboxplot
Itisbettertoshowconfidencelimitsthantoshow
±1
standarderror
Oftenitisbetterstilltoshowvariabilityofrawvalues(quartilesasinabox
plotsoastonotassumenormality,orS.D.)
Foraquickcomparisonofdistributionsofacontinuousvariableagainstmany
categories,tryboxplots.
Whencomparingtwoorthreegroups,overlaidempiricaldistributionfunction
plotsmaybebest,astheseshowallaspectsofthedistributionofacontinu-
ousvariable.
12.10 ShowingDifferences
Oftentheonlywaytoperceivedifferencesaccuratelyistoactuallycompute
differences;thenplotthem
Itisnotawasteofspacetoshowstratifiedestimatesanddifferencesbe-
tweenthemonthesamepageusingmultiplepanels
Convert pdf slides to powerpoint online - control application platform:C# Create PDF from PowerPoint Library to convert pptx, ppt to PDF in C#.net, ASP.NET MVC, WinForms, WPF
Online C# Tutorial for Creating PDF from Microsoft PowerPoint Presentation
www.rasteredge.com
Convert pdf slides to powerpoint online - control application platform:VB.NET Create PDF from PowerPoint Library to convert pptx, ppt to PDF in vb.net, ASP.NET MVC, WinForms, WPF
VB.NET Tutorial for Export PDF file from Microsoft Office PowerPoint
www.rasteredge.com
CHAPTER12. PRINCIPLESOFGRAPHCONSTRUCTION
114
Thisalsoaddressestheproblemthatconfidencelimitsfordifferencescan-
notbeeasilyderivedfromintervalsforindividualestimates;differencescan
easilybesignificantevenwhenindividualconfidenceintervalsoverlap.
Humanscan’tjudgedifferencesbetweensteepcurves;oneneedstoactually
computedifferencesandplotthem.
12.11 ChoosingtheBestGraphType
Therecommendationsthatfollowaregoodontheaverage,butbesuretothink
aboutalternativesforyourparticulardataset. Fornonparametrictrendlines,it
isadvisabletoadda“rug”plottoshowthedensityofthedatausedtomake
thenonparametricregressionestimate.Alternatively,usethebootstraptoderive
nonparametricconfidencebandsforthenonparametricsmoother.
12.11.1 SingleCategoricalVariable
Useadotplotorhorizontalbarcharttoshowtheproportioncorrespondingto
eachcategory.Secondchoicesforvaluesarepercentagesandfrequencies.The
totalsamplesizeandnumberofmissingvaluesshouldbedisplayedsomewhere
onthepage. Iftherearemanycategoriesandtheyarenotnaturallyordered,
youmaywanttoorderthembytherelativefrequencytohelpthereaderestimate
values.
12.11.2 SingleContinuousNumericVariable
Anempiricalcumulativedistributionfunction,optionallyshowingselectedquan-
tiles,conveysthemostinformationandrequiresnogroupingofthevariable. A
boxplotwillshow selected quantiles effectively, and box plots are especially
usefulwhenstratifyingbymultiplecategoriesofanothervariable. Histograms
arealsopossible.
control application platform:VB.NET PowerPoint: Read, Edit and Process PPTX File
split PowerPoint file, change the order of PPTX sildes and extract one or more slides from PowerPoint How to convert PowerPoint to PDF, render PowerPoint to
www.rasteredge.com
control application platform:C# PowerPoint - How to Process PowerPoint
slide processing library provides users with access to operate PowerPoint slides/pages in the simplest procedures, for instance, using online clear C# methods
www.rasteredge.com
CHAPTER12. PRINCIPLESOFGRAPHCONSTRUCTION
115
12.11.3 CategoricalResponseVariablevs.CategoricalInd.Var.
Thisisessentiallyafrequencytable.Itcanalsobedepictedgraphically
12.11.4 CategoricalResponsevs.aContinuousInd.Var.
Chooseoneormorecategoriesanduseanonparametricsmoothertorelatethe
independentvariabletotheproportionofsubjectsinthecategoriesofinterest.
Showarugplotonthe
x
-axis.
12.11.5 ContinuousResponseVariablevs.CategoricalInd.Var.
If there are only two or three categories, , superimposed d empiricalcumulative
distributionplotswithselectedquantilescanbequiteeffective. Alsoconsider
boxplots,oradotplotwitherrorbars,todepictthemedianandouterquartiles.
Occasionally,aback-to-backhistogramcanbeeffectivefortwogroups (seethe
Hmisc
histbackback
function).
12.11.6 ContinuousResponsevs.ContinuousInd.Var.
Anonparametricsmootherisoftenideal. Youcanaddrugplotsforthe
x
-and
y
-axes,andifthesamplesizeisnottoolarge,plottherawdata. Ifyoudon’t
trustnonparametricsmoothers,groupthe
x
-variableintointervalshavingagiven
numberofobservations,andforeach
x
-intervalplotcharacteristics(3quartiles
ormean
±
2SD,forexample)vs.themean
x
intheinterval. Thisisdoneauto-
maticallywiththeHmisc
xYplot
function withthe
methods=’quantile’
option.
control application platform:VB.NET PowerPoint: Process & Manipulate PPT (.pptx) Slide(s)
add image to slide, extract slides and merge library SDK, this VB.NET PowerPoint processing control powerful & profession imaging controls, PDF document, image
www.rasteredge.com
control application platform:VB.NET PowerPoint: Sort and Reorder PowerPoint Slides by Using VB.
clip art or screenshot to PowerPoint document slide large amount of robust PPT slides/pages editing powerful & profession imaging controls, PDF document, image
www.rasteredge.com
CHAPTER12. PRINCIPLESOFGRAPHCONSTRUCTION
116
12.12 ConditioningVariables
Youcancondition(stratify)ononeormorevariablesbymakingseparatepages
bystrata,bymakingseparatepanelswithinapage,andbysuperposinggroups
ofpoints(usingdifferentsymbolsorcolors)orcurveswithinapanel. Theac-
tualmethodofstratifyingontheconditionalvariable(s)dependsonthetypeof
variables.
Categoricalvariable(s): Theonlychoicetomakeinconditioning(stratifying)
oncategoricalvariablesiswhethertocombineanylow-frequencycategories.
Ifyoudecidetocombinethemonthebasisofrelativefrequenciesyoucan
usethe
combine.levels
functioninHmisc.
Continuousnumericvariable(s):Unfortunately,toconditiononacontinuous
variable without the use e of f a parametric statistical model, , one e must split
thevariableintointervals. Thefirstchoiceiswhethertheintervalsofthe
numericvariableshouldbeoverlappingornon-overlapping. Fortheformer
thebuilt-in
equal.count
function can n beused forapanelingorgrouping
variableintrellisgraphics(theseoverlappingintervalsarecalled“shingles”
intrellis). Fornon-overlappingintervalstheHmisc
cut2
function isagood
choicebecauseofitsmanyoptionsandcompactlabeling.
control application platform:VB.NET PowerPoint: Use PowerPoint SDK to Create, Load and Save PPT
Besides, users also can get the precise PowerPoint slides count as soon as the PowerPoint document has been loaded by using the page number getting method.
www.rasteredge.com
control application platform:VB.NET PowerPoint: Extract & Collect PPT Slide(s) Using VB Sample
want to combine these extracted slides into a please read this VB.NET PowerPoint slide processing powerful & profession imaging controls, PDF document, image
www.rasteredge.com
Chapter13
GraphicsforOneorTwoVariables
AH11.1,11.3
See
·
www.math.montana.edu/~umsfjban/Courses/Stat438/Text/Comprehensive.
toc.html
·
http://exploringdata.cqu.edu.au
·
http://davidmlane.com/hyperstat/desc_univ.html
·
http://www.statsoft.com/textbook/stgraph.html
·
http://www.itl.nist.gov/div898/handbook/eda/section1/eda15.htm
13.1 One-DimensionalScatterplot
C133
·
Rugplot;usefulbyitselforoncurvesoraxes
117
control application platform:VB.NET PowerPoint: Merge and Split PowerPoint Document(s) with PPT
of the split PPT document will contain slides/pages 1-4 code in VB.NET to finish PowerPoint document splitting If you want to see more PDF processing functions
www.rasteredge.com
control application platform:VB.NET PowerPoint: Complete PowerPoint Document Conversion in VB.
It contains PowerPoint documentation features and all PPT slides. Control to render and convert target PowerPoint or document formats, such as PDF, BMP, TIFF
www.rasteredge.com
CHAPTER13. GRAPHICSFORONEORTWOVARIABLES
118
·
Showsallrawdatavalues
·
Forlargedatasets,drawrandomthirdsofverticalticktoavoidblackblob
·
Old-styledotplotsaresimilartorugplots
·
CanuseCleveland’sdotchartstoshowrawdata
rug(x)
# basic c built-in rug g plot function
datadensity(mydataframe)
# show 1-d scatterplot t for all l variables
dotplot(x)
# one variable
dotplot(∼ x)
# same thing
stripplot(x)
# Trellis s version
stripplot(∼ x)
# ditto
hist(x)
scat1d(x)
# add rug g plot t at t top of f histogram
plot(x, y)
scat1d(x)
# rug plot for x x at t top
scat1d(y, side=4)
# rug plot for y y at t right side
# scat1d d has many options
13.2 Histogram
C3.3,133-6
·
Usedforestimatingtheprobabilitydensityfunction
f(x)=lim
δ→0
Prob(x−δ<X≤x)/δ
(13.1)
·
Verydependentonhowbinsformed,andnumberofbins
·
y
-axiscanbefrequencyorproportion
·
Nostatisticalestimatescanbereaddirectlyoffahistogramordensityplot
hist(x, nclass=i)
# use i i bins
control application platform:VB.NET PowerPoint: Convert & Render PPT into PDF Document
Using this VB.NET PowerPoint to PDF converting demo code below, you can easily convert all slides of source PowerPoint document into a multi-page PDF file.
www.rasteredge.com
control application platform:VB.NET PowerPoint: Add Image to PowerPoint Document Slide/Page
insert or delete any certain PowerPoint slide without methods to reorder current PPT slides in both powerful & profession imaging controls, PDF document, tiff
www.rasteredge.com
CHAPTER13. GRAPHICSFORONEORTWOVARIABLES
119
histogram(x)
# Trellis s version
histogram(∼ x)
histSpike(x)
# high-res spike e histogram
plot(x, y)
histSpike(x, add=T)
# add spike histogram m to o existing g plot, , x-axis
Note:
histSpike
iscalledautomaticallyby
scat1d
when
n
islarge(bydefault,
≥2000
)
13.3 DensityPlot
Rosner5.1-5.2
·
Smoothedhistogram
·
Smoothestimateof
f(x)
above
·
Dependsonchoiceofasmoothingparameter
plot(density(x), type=’l’)
densityplot(∼ x) # # Trellis s version
hist(x, probability=T, nclass=20); ; lines(density(x)) ) # # ditto
# probability=T scales s y-axes s so o area under r curve is s 1.0
13.4 EmpiricalCumulativeDistributionPlot
Rosner4.6,5.4
·
Populationcumulativedistributionfunctionis
F(x)=Prob(X≤x)
(13.2)
·
F(b)−F(a)=Prob(a<X ≤b)
andistheareaunderthedensityfunction
f(x)
from
a
to
b
·
Estimateof
F(x)
istheempiricalcumulativedistributionfunction,whichis
theproportionofdatavalues
≤x
CHAPTER13. GRAPHICSFORONEORTWOVARIABLES
120
·
Cumulativehistogram
·
Worksfineifhistogramhasoneobservationperbin
·
ECDFrequiresnobinningandisunique
·
Excellentforshowingdifferencesinentiredistributionsbetweentwoorthree
overlaidgroups
·
QuantilescanbereaddirectlyoffECDF
ecdf(mydataframe)
# show all continuous s variables
ecdf(x)
ecdf(x, q=c(.2,.8))
# reference e lines for .2 2 and d .8 quantiles
ecdf(x, datadensity=’rug’)
# add rug plot
ecdf(x, datadensity=’hist’)
# add spike e histogram
ecdf(x, datadensity=’density’) # # add density y plot
ecdf(∼ x)
# Trellis s version
13.5 BoxPlot
C139-142
·
Mostusefulforcomparingmanygroups
·
Basicallyuses3-numbersummary:3quartiles
·
Easytoalsoshowmean
·
Canbeextendedtoshowotherpercentiles,especiallyfartheroutinthetails
ofthedistribution
·
Usuallyshowlowerandupper“adjacent”values(“whiskers”)and“outside”
values;somefindthesenottobeuseful
CHAPTER13. GRAPHICSFORONEORTWOVARIABLES
121
boxplot(x)
# basic c function
plot(groups, x)
# stratified, , vertical boxes
boxplot(split(x,groups))
# same
bpplot(split(x,groups))
# box-percentile e plot, shows 101 percentiles
bwplot(x)
# basic c horizontal box plot, Trellis
bwplot(∼ x)
# ditto
bwplot(x, panel=panel.bpplot)
# horizontal l box-percentile plot
13.6 ScatterPlots
C100-1,3.1,3.5,4.8
·
Excellentforshowingrelationshipbetweenasemi-continuous
X
andacon-
tinuous
Y
·
Doesnotworkwellforhuge
n
unlessrelationshipistight
·
Canusetransformedaxes,ortransformeddatamaybeplotted
·
Canshowalimitednumberofclassesofpointsthroughtheuseofdifferent
symbols
plot(x, y)
plot(x, y, , log=’xy’)
# double e log plot, nonlinear axes
plot(log(x), log(y))
# log plot, , log g axes
plot(x, y, , main=’Main Title’)
plot(x, y, , xlab=’X X label’, , ylab=’Y label’,
xlim=c(0,1), ylim=c(20,100))
xyplot(y ∼ ∼ x)
# Trellis
13.7 OptionalCommandstoEmbellishNon-TrellisPlots
13.7.1 Titles
plot(x, y, , main=’Main Title’)
plot(x, y)
CHAPTER13. GRAPHICSFORONEORTWOVARIABLES
122
title(’Main Title’)
title(sub=’Subtitle’, adj=0)
# adj=0,.5,1 1 for r left, , center, , right-justification
title(’First Line\nSecond d Line’)
# Use \n n to o jump down one line on n output
par(mfrow=c(2,2),oma=c(0,0,2,0))# 2x2 matrix x of f plots, , leave 2 2 lines s for
plot( )
# overall top p title e (oma = = outer margins)
hist( )
...
mtitle(’Overall Title’)
pstamp()
# date-time e stamp lower right t corner
13.7.2 AddingLines,Symbols,Text,andAxes
plot(x, y)
axis(3)
# add axis on n top (ticks s & & labels)
axis(4, labels=FALSE)
# add axis on n right t (ticks s only)
lines(1:3, c(2,4,-1))
# add x=1:3, , y=2, 4, , -1
points(x2, y2)
points(locator())
# add clicked d points
text(.2, 1.3, ’Text’)
# add text
text(locator(1), ’Mytext’)
# add text at t click
13.7.3 ReferenceLines
abline(a=0, b=1)
# line of identity y (a,b=intercept,slope)
abline(a=0, b=1, lty=2)
# dotted d line
abline(h=c(1,3))
# horizontal l line at t y=1,3
abline(v=0)
# vertical line at t x=0
13.8 ChoosingSymbols,Colors,andLineTypes
AH12.1.3
show.pch()
# display all l symbols
points(x, y, , pch=i)
# use symbol l i i from this display
show.col()
# show all colors
points(x, y, , col=i)
Linetypesarespecifiedwithan
lty
argument.SeeAHFigure12.4.
Documents you may be interested
Documents you may be interested