Chapter14
ConditioningandPlottingThreeorMore
Variables
14.1 Conditioning
C114,152-3,167,249-0,267
C3.10,3.11,4.9
·
Chooseoneortwovariablesofprincipalinterest
– Typicallyoneforhistograms,ECDFs,densityplots
– Twoforscatterplots
– Oneortwofordotplots
·
Canconditionon(holdconstant)effectsofothervariablesusingastatistical
model(notcoveredinthiscourse)orbysubsettingdata
·
Subsetsusuallynon-overlappingforcategoricalconditioning(stratification)
variables
·
Mayormaynotbeoverlapping(shingles)intervalsforcontinuouscondition-
123
Convert pdf into powerpoint online - software Library project: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 into powerpoint online - software Library project: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
CHAPTER14. CONDITIONINGANDPLOTTINGTHREEORMOREVARIABLES
124
ingvariables
·
Conditioningmaybeshowninmanyways
– differentsymbolsorcolorsfordifferentgroupsonascatterplotordotplot
– differentlinestylesorcolorsonalinesplotshowingmultiplecurves,or
carefullylabeledcurveswhichusethesamelinestyles
– adjacentlinesofdotsonadotplot
– differentvertical,horizontal(orboth)panels
– differentpages,includinglayeredtransparencies
– dynamicallyinrealtimeusing“brushing”andotherinteractivetechniques
·
Cleveland’sprincipalofsmallmultiples
SeeSection12.12oftheselecturenotes.
14.2 DotPlots
C3.4,4.1,4.6,4.9
C267,269
·
Ideal for showing howoneormore categoricalvariables are relatedtoa
singlecontinuousnumericresponsevariable
·
Continuousconditioningvariablesmustbecategorized
·
Thisisusuallydonebycreatingintervalscontainingequalsamplesizes
·
Canshowerrorbarsandothersuperpositioning
software Library project:Online Convert PowerPoint to PDF file. Best free online export
Convert a PPTX/PPT File to PDF. Just upload your file by clicking on the blue button or drag-and-drop your pptx or ppt file into the drop area.
www.rasteredge.com
software Library project:RasterEdge XDoc.PowerPoint for .NET - SDK for PowerPoint Document
Convert PowerPoint to ODP/ ODP to PowerPoint. Insert Pages into PowerPoint File. Download Free Trial Download and try PDF for .NET with online support.
www.rasteredge.com
CHAPTER14. CONDITIONINGANDPLOTTINGTHREEORMOREVARIABLES
125
·
DoneusingTrellis
dotplot
orHmiscTrellis
Dotplot
function(later)orusing
basic
dotchart2
functioninHmisc
·
Createdautomaticallywhenplottingcertainobjectscreatedby
summary.formula
14.3 ThermometerPlots
C240-1
·
Usefulinproblemsthataresimilartothosehandledbydotplots
·
Butthermometersmaybepositionedirregularly
·
Idealforgeographicaldisplays
·
Seeexamplefromonlinehelpfilefor
symbols
·
FordepictingcontingencytablesseetheHmisc
symbol.freq
function
AH6.3
14.4 ExtensionsofScatterplots
14.4.1 SinglePlots
CFig.I,3.5,3.10
C3.11,3.13,4.4
·
Varysymbols,colors—bestforconditioningoncategoricalvariables
·
Bubbleplots: can n depictanadditioncontinuousvariablewhichmaybea
secondresponsevariable
·
Radiusofcirclesplottedisproportionaltothethirdvariable
x ← ← 1:10
y ← ← runif(10)
software Library project:C# PDF insert text Library: insert text into PDF content in C#.net
Able to add a single text character and text string to PDF files using online source codes in C#.NET class value, The char wil be added into PDF page, 0
www.rasteredge.com
software Library project:XDoc.HTML5 Viewer for .NET, Zero Footprint AJAX Document Image
View, Convert, Edit, Sign Documents and Images. viewer library can be easily integrated into your ASP powerful & profession imaging controls, PDF document, image
www.rasteredge.com
CHAPTER14. CONDITIONINGANDPLOTTINGTHREEORMOREVARIABLES
126
z ← ← runif(10)
symbols(x, y, circles=z, inches=.2) ) # # largest t is s .2in
14.4.2 ScatterplotMatrices
C3.9,KO217
·
Showallpairwiserelationshipsfromamong3ormorecontinuousvariables
x ← ← matrix(rnorm(200*5),ncol=5)
pairs(x)
pairs(mydataframe[,c(’age’,’pressure’,’weight’,’height’)])
·
Trellisfunction:
splom
14.5 3-DPlotsforAlmostSmoothSurfaces
KO193-6
·
GUIplusseveralfunctions
·
Perspectiveplot:simulated3-Dsurface
·
Contourplot
·
Imageplot:3rdvariablecategorizedinto,forexample,10intervals;
Shownusingcolor(e.g.,heatspectrum)orgrayscale
Seemainwebpageforimageplotexamples
CFig.II,211-2,4.3
·
BasicS-P
LUS
functions:
persp, contour, , image
software Library project:C# PDF Convert to Tiff SDK: Convert PDF to tiff images in C#.net
with specified zoom value and save it into stream The magnification of the original PDF page size Description: Convert to DOCX/TIFF with specified resolution and
www.rasteredge.com
software Library project:C# PDF File Split Library: Split, seperate PDF into multiple files
SharePoint. C#.NET control for splitting PDF file into two or multiple files online. Support to break a large PDF file into smaller files.
www.rasteredge.com
CHAPTER14. CONDITIONINGANDPLOTTINGTHREEORMOREVARIABLES
127
14.6 DynamicGraphics
14.6.1 InteractivelyIdentifyingPoints
AH11.2
·
Ifuse
plot
or
points
·
Use
identify(x, y, , labels=rowlabels)
plot(state.x91[,’Income’], state.x91[,’Murder’])
identify(state.x91[,c(’Income’,’Murder’)],
labels=dimnames(state.x91)[[1]])
·
Firstargumentto
identify
maybeavector(then2ndargumentis
y
-variable),
a2-columnmatrix,oralist
14.6.2 WireframeandPerspectivePlots
·
Worksforsmoothdataorsomewhattightrelationships
·
GUIisniceforthis
·
Caninteractivelylookat3-Dplotfromdifferentperspectives
·
Orcanautomaticallygetamatrixofplotsfromvaryingperspectives
14.6.3 BrushingandSpinning
C3.12
·
Useful for examining g relationships between multiple continuous s variables
whensomeoftherelationshipsaresomewhattight(dependingonthesam-
plesize)
software Library project:VB.NET PDF File Split Library: Split, seperate PDF into multiple
Split PDF file into two or multiple files in ASP.NET webpage online. Support to break a large PDF file into smaller files in .NET WinForms.
www.rasteredge.com
software Library project:C# PDF Page Insert Library: insert pages into PDF file in C#.net
from the ability to inserting a new PDF page into existing PDF or pages from various file formats, such as PDF, Tiff, Word, Excel, PowerPoint, Bmp, Jpeg
www.rasteredge.com
CHAPTER14. CONDITIONINGANDPLOTTINGTHREEORMOREVARIABLES
128
·
Brushing:highlightpointsinone2-Dscatterplot;showscorrespondingpoints
inother2-Dplots
·
Spinning:usemotiontosimulation3-Dpointclouds,rotating3rdvariablein
andoutofdisplay
brush(cbind(sbp, dbp, age, cholesterol), hist=T)
brush(x[,c(’sbp’,’dbp’,’age’,’cholesterol’)])
brush(x[,Cs(sbp,dbp,age,cholesterol)])
brush(state.x91)
# matrix x built-in to o S-Plus
brush(prim4)
# ’’ ’ ’’
·
Firstargumentto
brush
(amatrix)maynotcontain
NA
s
·
hist
argument:drawmarginalhistograms
14.6.4 “Live”GraphicsonWebSites
JavaGraphlets
·
S-P
LUS
6.xhasaJavagraphicsdevice(usedlikepostscriptdevicebutcan
specifyunderlyingdata)
·
Allowsdrillingdowntootherpre-programmedresults
·
Simpletouseonwebsites
S-P
LUS
StatServerandR
·
Canbuildweb sitesatwhichusers click on options, , S-P
LUS
isrunona
server,non-pre-programmedgraphicsarecreatedonthefly
·
Rcanbefreelyusedonwebservers
CHAPTER14. CONDITIONINGANDPLOTTINGTHREEORMOREVARIABLES
129
14.7 TrellisGraphics
AH11.4,KO6,UG6
Function
Purpose
FormulaArgument
barchart
Barchart
y ~ ~ x x | g1*g2
bwplot
Boxandwhiskerplot
y ~ ~ x x | g1*g2
densityplot
Probabilitydensityplot
~ x x | | g1*g2
dotplot
Dotplot
y ~ ~ x x | g1*g2
Dotplot
Hmiscgeneralizationof
dotplot
y ~ ~ x x | g1*g2
ecdf
HmiscECDFplot
~ x x | | g1*g2,
groups=g3
histogram
Histogram
~ x x | | g1*g2
parallel
Parallelcoordinateplot
~ x x | | g1*g2
panel.bpplot
enhancedboxplotsand
box–%-tileplotswith
bwplot
panel.plsmo
Hmisc
panel
functionfor
y ~ ~ x x | g1*g2,
xyplot
groups=g3
splom
Multi–panelscatterplotmatrices
~ x x | | g1*g2
stripplot
One–dimensionalscatterplot
y ~ ~ x x | g1*g2
xyplot
Conditioningplots/scatterplots
y ~ ~ x x | g1*g2
xYplot
Hmiscgeneralizationof
xyplot
Cbind(y,y2,y3) ~ ~ x x | | g1*g2,
formulti–column
y
groups=g3
setTrellis
Hmisc
trellis
setup
trellis.strip.blank
Hmiscfunctiontoset
trellis
touseblankbackgroundforpaneltitles
Generalformoffirstargument(statisticalformula):
vertical variable ∼ ∼ horizontal variable | | row.conditioner r *
column.conditioner * * page.conditioner, groups=superposition.variable
·
Variablesafter
|
areconditionedupontomakepanels(availableforallgraph
types)
·
groups
variablemakesseparatelinesorsymbolswithinapanel(notavail-
ableforallgraphtypes)
·
AllTrellisfunctionstake
data
and
subset
arguments.
14.7.1 AppropriatePaneling/GroupingVariables
·
Theseareassumeddiscrete
a
a
TheGUIwillautomaticallydiscretizecontinuousnumericvariableswhentheyareusedinpaneling.
CHAPTER14. CONDITIONINGANDPLOTTINGTHREEORMOREVARIABLES
130
·
Numericcontinuousvariablesneedtobediscretized
PanelVariables
·
Ifpanelvariableisadiscretenumericandyouwantthevaluetoexplicitly
showinthepanelstrip,specifye.g.
dotplot(y ∼ ∼ x x | | factor(g))
·
Forcontinuousvariable,panelsmaycorrespondtooverlappingintervals;to
createtheseuse
equal.count
or
shingle
functionsafterthe
|
·
Fornon-overlappingintervals,
cut2
isflexibleandprovidesnicepanellabel-
ing
14.7.2 ClassesofTrellisFunction
FunctionsPlottingAllDataPoints
Thefollowingfunctionsareoftenusedonrawdata. Theyarealsousedtoplot
summarydatacomputedonrawdata,whichwillbecoveredlater.
·
barchart
·
dotplot
·
Hmiscversionof
dotplot
:
Dotplot
·
parallel
·
splom
CHAPTER14. CONDITIONINGANDPLOTTINGTHREEORMOREVARIABLES
131
·
stripplot
·
xyplot
·
Hmiscversionof
xyplot
:
xYplot
FunctionsThatSummarizeDataandthenPlot
·
bwplot
: computes3quartiles,mean, , outervalues, etc.oneachgroupof
points(panel,verticalboxplotwithinpanel);thendrawsboxplot
·
density
:computessmoothestimateofdensityfunction,thenplots
·
ecdf
:computesECDFforeachgrouporpanel
·
histogram
:bins
x
-variable,computesfrequenciesforeachpanel
·
Note: for
density, ecdf, histogram
user has no controlover
y
-axis as
thesearecomputed
·
xYplot
hasanargument
method
thatcandoautomaticsummarizationofraw
data;summariesfedimmediatelyintoplots
Built-invs.Hmisc
·
For
dotplot
,
xyplot
youmustspecify
panel=panel.superpose
tousesu-
perposition,inadditiontospecifying
groups
·
Dotplot
,
xYplot
implicitlyhandlesuperpositionwhen
groups
isgiven
CHAPTER14. CONDITIONINGANDPLOTTINGTHREEORMOREVARIABLES
132
·
Dotplot, xYplot
allowforerrorbars(
xYplot
alsoallowsforerrorbands);
thesearecoveredlater
·
Dotplot, xYplot
use
label
attributesof
x
and
y
variablesforlabelingaxes
(ifnot
label
defined,usesvariablenamesaswithbuilt-inTrellisfunctions)
·
xYplot
sometimesusesdifferentdefaultsforthe
type
argument
– Usercantakecontrolbyspecifying
type=’l’,’p’,’b’
forlines,points,
orboth
·
Hmiscfunctionsdosomeautomatickeydrawing
·
xYplot
willdosomeautomaticdatasummarization
·
Hmischaspanelfunctionstobediscussedlater:
panel.bpplot
:canuseasareplacementfor
panel.bwplot
panel.plsmo
:canusewith
xyplot
toplotlowesstrendlines
14.7.3 PanelFunctions
KO6.4.9
·
AstrengthofTrellisisitsabilitytolettheuserspecifya
panel
argument
·
ThisdirectsTrellisinconstructingeachpanel;panelfunctiondoesnotneed
toknowaboutotherpanels
·
Panelfunctioncanbeasinglefunctionoritcancallmanypanelfunctions
·
Latterishowyoucombinegraphtypes(e.g.,rawdata+trendline)
Documents you may be interested
Documents you may be interested