Pratique de Sas Windows ...9.3 Volume 2 - Ined
Pratique de Sas Windows ...9.3 Volume 2 - Ined
Pratique de Sas Windows ...9.3 Volume 2 - Ined
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
On reprend donc notre programme là où nous l’avions laissé :<br />
ods graphics/ height=26cm width=15cm;*refline 22.7;<br />
proc sgscatter data=graphique tmplout="d:\notes\test\sgscattersymbol.sas";<br />
plot classval0 * ppct /group=variable columns=1 rows=10 uniscale=x join grid<br />
markerattrs=(symbol=square) ;<br />
format variable $intitule.;<br />
run;<br />
Mais en capturant le co<strong>de</strong> GTL caché <strong>de</strong>rrière le co<strong>de</strong> <strong>de</strong> la sgscatter, je récupère du co<strong>de</strong> GTL sans <strong>de</strong>voir en<br />
écrire et découvre l’instruction unique SeriesPlot<br />
proc template;<br />
<strong>de</strong>fine statgraph sgscatter;<br />
begingraph / <strong>de</strong>signwidth=640 <strong>de</strong>signheight=640;<br />
EntryTitle "Probabilités estimées en % " /;<br />
layout grid<strong>de</strong>d;<br />
layout lattice / pad=(top=5) rowgutter=10 columngutter=10 columns=1<br />
columnDataRange=unionall;<br />
layout overlay / xaxisopts=( griddisplay=on) yaxisopts=( griddisplay=on);<br />
SeriesPlot X=ppct Y=classval0 /<br />
primary=true display=(markers) CONNECTORDER=XAXIS<br />
Group=variable Markerattrs=(Symbol=SQUARE) NAME="PLOT";<br />
endlayout;<br />
endlayout;<br />
DiscreteLegend "PLOT" / or<strong>de</strong>r=rowmajor title="variable";<br />
endlayout;<br />
endgraph;<br />
end;<br />
run;<br />
Mais c’est l’impasse avec une seule instruction <strong>de</strong> tracé plot en sg ou seriesplot en gtl, car nous ne<br />
disposons pas <strong>de</strong>s moyens suffisants pour arriver à nos fins.<br />
Comme nous <strong>de</strong>vrons probablement sacrifier la légen<strong>de</strong> avec <strong>de</strong>s noms <strong>de</strong> variables dans une publication (<strong>de</strong><br />
format A4), nous <strong>de</strong>vons d’abord insérer cette information en entrecoupant la liste <strong>de</strong>s modalités par ces noms<br />
placés au bon endroit : d’où la création <strong>de</strong> la variable nord (pour ne pas le perdre ) dans la table graphique.<br />
data graphsan;<br />
length var mod $ 37;<br />
set graphique; by notsorted variable;<br />
var=put(variable,$intitule.);<br />
mod=classval0;<br />
if first.variable then output;<br />
output;<br />
run;<br />
data grapsan;<br />
set graphsan; by notsorted variable;<br />
if first.variable then do;<br />
mod=upcase( var);<br />
ppct=.;<br />
vp='';<br />
nord=.;<br />
end;<br />
else var='';<br />
if vp='- ' then vp="Ns ";<br />
run;<br />
…<br />
:::::: ::::::<br />
Nous disposons maintenant d’une variable mod complète et d’un vp avec la modalité "Ns" pour non-significatif.<br />
Le format $intitule. précé<strong>de</strong>nt a été remanié pour raccourcir les intitulés trop longs pour ce type <strong>de</strong> graphique.<br />
163 INED Service Informatique Wielki