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.
Le graphique retourné donne dans le titre du contenu passé par les macro-variables dynamiques pour la<br />
construction du <strong>de</strong>ndrogramme, avec donc maintenant compréhension du sens <strong>de</strong> ces mots mystérieux.<br />
Seul hvar passait quelque chose au cœur du <strong>de</strong>ndrogramme.<br />
Le reste porte plutôt sur <strong>de</strong>s options.<br />
Des Pixels pour dh et dw. Une orientation du <strong>de</strong>ndrogramme à l’horizontale. Des labels pour les axes.<br />
Xr et Yr restent inconnus, mais dès qu’on pense pour r à reverse, on comprend que le tracé peut être fait <strong>de</strong><br />
gauche à droite ou <strong>de</strong> droite à gauche : false annulant ce <strong>de</strong>rnier genre <strong>de</strong> tracé en reverse.<br />
Suppression du template <strong>de</strong> visualisation <strong>de</strong>s variables dynamiques.<br />
proc template;<br />
<strong>de</strong>lete Stat.Cluster.Graphics.Dendrogram / store=<strong>Sas</strong>user.templat;<br />
run;<br />
Attention NE PASSEZ ce DELETE que si vous avez bien fermé auparavant toute fenêtre ouverte du Template Store !<br />
Changement <strong>de</strong> magasin pour gar<strong>de</strong>r le co<strong>de</strong> <strong>de</strong> notre template modifié que nous allons enrichir, suite aux<br />
découvertes suivantes à propos <strong>de</strong> tracer une ligne en GTL.<br />
- Renvoi au manuel <strong>de</strong> <strong>Sas</strong> où j’ai trouvé : -<br />
Dans le manuel GTL (voir 3.6.8.1), au Chap 67 page773, l’instruction drawline ou au Chapitre 70 page 795,<br />
l’autre instruction drawtext.<br />
Mais au fond, l’instruction referenceline existe aussi et est plus facile à placer, car le drawtext utilisé ici<br />
travaille sur une échelle en un type <strong>de</strong> pourcentage, tandis que notre drawline utilise <strong>de</strong>s valeurs d’un autre type<br />
<strong>de</strong> pourcentage. Un ajustage x1 y1 x2 y2 <strong>de</strong> drawline est nécessaire.<br />
Le co<strong>de</strong> du <strong>de</strong>ndrogram exige 3 paramètres (no<strong>de</strong>id, parentid, clusterheight). Je le modifie et ajoute dans ma<br />
liste parent et name à hvar qui y était déjà présent, car je vais utiliser un appel à Sgren<strong>de</strong>r et <strong>de</strong>vrai passer du<br />
texte.<br />
libname tpl "D:\MY <strong>Sas</strong> Files\tpl";<br />
ods path (prepend) tpl.modtpl(update);<br />
proc template;<br />
<strong>de</strong>fine statgraph MonDendrogram;<br />
dynamic dh dw orient xlabel ylabel hvar xr yr parent name;<br />
notes "Dendrogram";<br />
begingraph / <strong>de</strong>signheight=dh <strong>de</strong>signwidth=dw;<br />
* entrytitle " dh: " dh " dw: " dw " orient: " orient;<br />
* entrytitle " xlabel: " xlabel " ylabel: " ylabel;<br />
* entrytitle " hvar: " hvar " xr: " yr " yr: " yr;<br />
* entrytitle "Cluster Analysis";<br />
layout overlay / xaxisopts=(label=xlabel reverse=xr)<br />
yaxisopts=(label=ylabel reverse=yr<br />
discreteopts=(tickvaluefitpolicy=none));<br />
<strong>de</strong>ndrogram no<strong>de</strong>id=name parentid=parent clusterheight=hvar /<br />
orient=orient;<br />
drawtext textattrs=(style=italic size=7pt)<br />
"choix du nombre <strong>de</strong> classes" /<br />
anchor=bottomleft width=25 widthunit=percent<br />
xspace=wallpercent yspace=wallpercent<br />
x=20 y=5 justify=center ;<br />
drawline x1=32 y1=5 x2=32 y2=100 /<br />
lineattrs=GraphReference layer=front;<br />
/* ou* * referenceline x=0.08 / curvelabel='0.08' curvelabellocation=insi<strong>de</strong><br />
curvelabelposition=max;<br />
endlayout;<br />
endgraph;<br />
end;<br />
run;<br />
Les instructions drawtext et drawline ont été quasiment copiés <strong>de</strong>s exemples du manuel GTL.<br />
Le drawtext écrira les textes entre quotes à un endroit défini à partir d’un ancrage bas gauche avec <strong>de</strong>s<br />
coordonnées exprimées en pourcentage.<br />
Il sera centré à l’intérieur d’un espace <strong>de</strong> 25 unités positionné en x 20 et y 5.<br />
La ligne (drawline) sera tracée entre <strong>de</strong>s coordonnées (x,y) en bas 32,5 et en haut 32,100.<br />
180 <strong>Pratique</strong> <strong>de</strong> <strong>Sas</strong> windows ….93 <strong>Volume</strong> 2 et Coll.