Statistiques, M2

Transcription

Statistiques, M2
Statistiques, M2-IAD:MI5
[email protected]
5 octobre 2011
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
1 / 63
Graphisme
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
[email protected]
Première partie I
Le Graphisme
Statistiques, M2-IAD:MI5
5 octobre 2011
2 / 63
Graphisme
Paragraphe
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
Introduction
Les options graphiques
Les symboles
Les axes
La procédure GPLOT
Les tables d’annotation
Fichiers graphiques
ods
Formats graphiques
La procédure greplay
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
3 / 63
Graphisme
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
SAS/Graph : la procédure de
graphisme
Ce module permet de tracer des graphes haute résolution en
pouvant utiliser plusieurs types de sorties graphiques :
Les procédures les plus utilisées :
I
gplot tracé de ligne, points, textes.
I
gchart diagramme en bâtons
I
gmap tracer de cartes
I
insight graphisme par menu
I
goptions définition des options graphiques
I
greplay combiner plusieurs sorties graphiques
I
ods redirection des sorties vers un fichier graphique
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
4 / 63
Graphisme
Graphisme : plot et gplot
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
/* plot et gplot */
%include ’i:\users\francois\tex\stat\sas\exemples\data-table-classe.sas’;
proc plot data=class;
plot height*weight;
title ’Trace texte hauteur en fonction du poids’;
run;
/* gplot */
proc gplot data=class;
plot height*weight;
title ’Trace hauteur en fonction du poids’;
run;
/* et en fonction du sexe */
proc gplot data=class;
plot height*weight=sex;
title ’Trace hauteur en fonction du poids’;
run;
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
5 / 63
Graphisme
Graphisme : plot
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
Trace texte hauteur en fonction du poids
Plot of hauteur*poids.
15:58 Monday, January 12, 2004
1
Legend: A = 1 obs, B = 2 obs, etc.
hauteur
75
A
70
A
A
B
65
A
A
A
A
A
A
60
A
A
A
A
A
A
A
55
A
50
40
60
80
3
100
120
140
160
poids
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
6 / 63
Graphisme
Graphisme : gplot
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
hauteur
80
70
60
50
50
60
70
80
90
100
110
120
130
140
150
poids
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
7 / 63
Graphisme
Graphisme : gchart
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
/* diagramme en batons */
proc gchart data=classe gout=graphique;
vbar hauteur;
title ’Histogramme des hauteurs’;
run;
/* vbar y|subgroup=x histo supperposés*/
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
8 / 63
Graphisme
Graphisme : gchart
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
FREQUENCY
6
5
4
3
2
1
0
52.5
57.5
62.5
hauteur
[email protected]
Statistiques, M2-IAD:MI5
67.5
72.5
MIDPOINT
5 octobre 2011
9 / 63
Graphisme
Graphisme : gmap
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
/* gmap*/
data dpts;
do id=1 to 100;
val=2*id;
output;
end;
run;
proc gmap map=maps.france data=dpts;
id id;
choro val;
title ’Trace de carte’;
run;
quit;
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
10 / 63
Graphisme
Graphisme : gmap
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
11 / 63
Graphisme
Graphisme : scatterplot
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
/* plot scatterplot */
proc plot data=classe vpercent=33 hpercent=33 nolegend ;
plot (age hauteur poids )
* (age hauteur poids ) = sexe;
run;
/* insight SAS/Insight Statements*/
PROC INSIGHT DATA=user.classe;
SCATTER age hauteur poids*age hauteur poids;
title ’Scatterplot’;
run;quit;
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
12 / 63
Graphisme
Graphisme : scatterplot
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
16
age
11
72.0
hauteur
51.3
150.0
poids
50.5
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
13 / 63
Graphisme
Graphisme : g3d
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
/* g3d */
data chapeau;
do x=-5 to 5 by 0.25;
do y=-5 to 5 by 0.25;
z=sin(sqrt(x*x+y*y));
output;
end;
end;
run;
proc g3d data=chapeau gout=graphique ;
plot y*x=z;
title ’Exemple de trace 3d chapeau’;
run;
quit;
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
14 / 63
Graphisme
Graphisme : g3d
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
15 / 63
Graphisme
Graphisme : greplay
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
Le but de cette procédure est de traduire, de réunir différents
graphiques d’un même catalogue.
/* greplay */
filename psdir "I:\users\Francois\TEX\stat\SAS\ps";
goptions hsize=20cm vsize=20cm gsfname=psdir device=pslepsfc;
proc greplay igout=graphique nofs;
replay _ALL_;
run;
quit;
/* goptions reset */
goptions reset=all;
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
16 / 63
Graphisme
Paragraphe
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
Introduction
Les options graphiques
Les symboles
Les axes
La procédure GPLOT
Les tables d’annotation
Fichiers graphiques
ods
Formats graphiques
La procédure greplay
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
17 / 63
Graphisme
Les instructions globales
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
quit
ferme les fichiers graphiques
goptions
options des procédures graphiques
title[n]
titre des graphiques
legend[n]
légendes
footnote[n] pied de page des graphiques
axis[n]
définition d’un axe d’affichage
symbol[n]
définition d’un type trait ou points
Remarque : 1 ≤ n ≤ 10
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
18 / 63
Graphisme
goptions
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
Cette instruction permet de définir les options graphiques de
SAS.. La syntaxe de l’instruction goptions est :
goptions par1=val1 par2=val2 ...;
Pour ré initialiser un paramètre :
goptions par1=;
Pour tout réinitialiser :
goptions reset=all;
Pour voir un paramètre graphique on peut utiliser :
proc goptions option=nom_option;run;
Pour voir toutes les options graphiques :
proc goptions;run;
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
19 / 63
Graphisme
goptions
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
device=(win,gif,png,pslepsfc,psepsf)
gsfname=fichier
display
nodisplay
body=rep
htex=n
ctext=(RED,...)
ftext=(SWISS,...)
ftitle=(SWISS,...)
reset=all
rotate=(landscape,portrait)
border
noborder
path=rep
[email protected]
périphérique de sortie
nom du ou des fichiers de sorties
sortie écran
pas de sortie écran
répertoire racine en cas de sortie html
hauteur de la fonte
couleur de la fonte
police du texte
police du titre
paramètres par defaut
paysage ou portrait
bord dans l’image
pas de bord
racine des répertoires en sortie html
Statistiques, M2-IAD:MI5
5 octobre 2011
20 / 63
Graphisme
Paragraphe
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
Introduction
Les options graphiques
Les symboles
Les axes
La procédure GPLOT
Les tables d’annotation
Fichiers graphiques
ods
Formats graphiques
La procédure greplay
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
21 / 63
Graphisme
Les types de traits
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
Ils sont définis par l’intermédiaire d’une variable globale
symbol[n].Ce symbole sera utilisé comme type de trait par le
premier tracé d’une fonction
symbol[n]
symbole numéro n
ci=(RED,...)
couleur de la ligne
c=(BLUE,...)
couleur des symboles
v=(SQUARE,...) symbole dessiné
height=n
hauteur du symbole
interpol=JOIN
interpolation affine
l=(1,2...,46)
2 à 46 pointillé
w=(1,...) ;
épaisseur du trait
symbol[n] ;
réinitialisation (sans option)
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
22 / 63
Graphisme
Symbol
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
symbol1
width=1
v=SQUARE
interpol=join
color=RED
ci=BLUE;
PROC GPLOT DATA=SINUS;
PLOT Y*X=1; /* symbol1 utilisé */
TITLE ’Graphe de y=xsin(2x);test symbol’;
run;
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
23 / 63
Graphisme
Graphisme : symbol
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
Y
4
3
2
1
0
-1
-2
-3
0
1
2
3
4
5
X
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
24 / 63
Graphisme
Paragraphe
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
Introduction
Les options graphiques
Les symboles
Les axes
La procédure GPLOT
Les tables d’annotation
Fichiers graphiques
ods
Formats graphiques
La procédure greplay
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
25 / 63
Graphisme
Les définitions d’axes
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
Ils sont définis par l’intermédiaire d’une variable globale
axe[n].
axis[n]
axe numéro n
width=n
épaisseur du trait
order=xinf to xsup by pas
tirets sur l’axe
order=(x1 ... xn)
place tirets
label=(angle=90 rotate=0 ”texte”) tracé de légende
minor=(none,...)
tirets intermédiaires
color=(RED,...)
couleur de l’axe
Attention dans order= les espaces entre les points sur la figure
sont égaux : (0,1,1000) !
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
26 / 63
Graphisme
Axis
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
axis1
width=5
order=(0 2.5 5)
label=(angle=0 rotate=0)
minor=none
color=PURPLE;
PROC GPLOT DATA=SINUS;
PLOT Y*X/haxis=axis1;
TITLE ’Graphe de y=xsin(2x);test axis’;
run;
PROC GPLOT DATA=SINUS;
PLOT Y*X/
haxis=0 to 5 by 2.5
vaxis=-4 to 4 by 2;
TITLE ’Graphe de y=xsin(2x);test axis’;
run;
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
27 / 63
Graphisme
Graphisme : axis
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
Y
4
3
2
1
0
-1
-2
-3
0.0
2.5
5.0
X
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
28 / 63
Graphisme
Paragraphe
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
Introduction
Les options graphiques
Les symboles
Les axes
La procédure GPLOT
Les tables d’annotation
Fichiers graphiques
ods
Formats graphiques
La procédure greplay
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
29 / 63
Graphisme
Procédure gplot
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
Les options principales de la procédure gplot sont :
proc gplot
data=lib.x
nom de la table utilisée
gout=lib.catalogue ; nom du catalogue de sortie
instruction 1 ;
...
instruction n ;
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
30 / 63
Graphisme
Gplot :instuction plot
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
L’instruction de la procédure gplot est principalement
l’instruction plot (et aussi bubble). Cette instruction permet de
dessiner y en fonction de x avec le trait défini par le symbole n.
On trace des points qui sont fonctions de la variable
mentionnée après le signe = :
plot
y1*x1[=n—var] trait symbole n
y2*x2[=n—var]
... /
début des options de plot
option1
... ;
fin de l’instruction plot
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
31 / 63
Graphisme
Gplot : options de plot
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
[email protected]
overlay
annotate=lib.x
descrition=”titre”
name=toto
cframe=SALMON
caxis=RED
ctext=GREEN
vaxis=axis1
haxis=axis2
href=y0
vref=x0
legend=legend[n]
autovref
superposition
table d’annotation
titre ds fen resultat
nom de l’elt dans le catalogue
couleur du fond
couleur des axes
couleur du texte
axe vertical défini par axis1
axe horizontal défini par axis2
trait horizontal y=y0
trait vertical x=x0
légende pour le tracé
met une ligne hori sur chaque barre de l axe vert
Statistiques, M2-IAD:MI5
5 octobre 2011
32 / 63
Graphisme
gplot
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
/*hauteur(poids) |sexe */
proc gplot data=classe;
plot hauteur*poids=sexe/
cframe=YELLOW
href=100
vref=70
description="Essai";
/* fond */
/* trait vertical x=100*/
/* trait horizontal y=70*/
run;
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
33 / 63
Graphisme
Graphisme : gplot
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
hauteur
80
70
60
50
50
60
70
80
sexe
[email protected]
90
100
poids
F
Statistiques, M2-IAD:MI5
110
120
130
140
150
M
5 octobre 2011
34 / 63
Graphisme
Graphisme :gplot :overlay
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
L’option OVERLAY de l’instruction plot permet de superposer
plusieurs tracé de courbes sur une même figure.
%include ’I:\users\francois\tex\stat\SAS\exemples\data-table-classe.sas’;
proc gplot data=class;
plot height*age=’H’ weight*age=’W’ /
OVERLAY
vaxis=50 TO 150 by 50
haxis=10 TO 15 by 1;
run;
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
35 / 63
Graphisme
Graphisme :gplot :overlay
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
height
150
W
W
W
W
W
W
100
W
W
W
W
W
W
W
W
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
14
15
H
H
W
50
10
11
12
13
age
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
36 / 63
Graphisme
Paragraphe
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
Introduction
Les options graphiques
Les symboles
Les axes
La procédure GPLOT
Les tables d’annotation
Fichiers graphiques
ods
Formats graphiques
La procédure greplay
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
37 / 63
Graphisme
Table d’annotation
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
La table d’annotation permet d’ajouter à un graphisme du
texte,des traits.Chaque ligne de cette table correspond à une
instuction graphique, les autres valeurs sont les arguments de
cette instruction.
function move bar draw symbol label fonction appelée
x
abscisse
y
ordonnée
xsys
2 unité définie par l’axe des x
ysys
2 unité définie par l’axe des y
color
couleur
line
type de trait
text
chaine à afficher
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
38 / 63
Graphisme
gplot : gplot : annotate
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
data boussole;
length c $5;
x=1;y=0;c="Est";output;
x=0;y=1;c="Nord";output;
x=-1;y=0;c="Ouest";output;
x=0;y=-1;c="Sud";output;
data annotate;
length function $6 text $10 color $10;
set boussole(rename=(x=x1 y=y1));
xsys=’2’;ysys=’2’;
function=’move’;x=0;y=0;output;
function=’draw’;x=x1;y=y1;color=’red’;line=3;output;
function=’label’;x=x1;y=y1;text=c;color=’red’;output;
function=’symbol’;x=x1;y=y1;color=’blue’;text=’CIRCLE’;size=5;output;
keep function xsys ysys x y text color line size;
proc gplot data=boussole;
plot y*x/annotate=annotate;
run;
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
39 / 63
Graphisme
Graphisme : gplot : annotate
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
y
1
Nord
O
0u e s t
-1
Est
Sud
-1
0
1
x
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
40 / 63
Graphisme
Paragraphe
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
Introduction
Les options graphiques
Les symboles
Les axes
La procédure GPLOT
Les tables d’annotation
Fichiers graphiques
ods
Formats graphiques
La procédure greplay
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
41 / 63
Graphisme
Manipulation des sorties de SAS
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
On veut avoir des sorties de résultats ou graphiques sous
différents formats
I
rtf rich text format
I
pdf
I
texte
I
formats d’image ps,gif,png
I
format Web html
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
42 / 63
Graphisme
Paragraphe
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
Introduction
Les options graphiques
Les symboles
Les axes
La procédure GPLOT
Les tables d’annotation
Fichiers graphiques
ods
Formats graphiques
La procédure greplay
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
43 / 63
Graphisme
Ouput delivery system
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
44 / 63
Graphisme
ods : global statement
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
L’instruction globale ods output delivery system, permet de
traduire de rediriger des sorties textes et graphiques de SAS,
dans des formats spécifiques.
texte la sortie standard de la fenêtre de log est dite au
format listing. On peut avoir aussi des sorties
dans des fichiers au format rtf ou html.
graphique on peut avoir des fichiers au format
postscript,gif,... correspondant au objets
graphiques de catalogues.
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
44 / 63
Graphisme
Ods : sortie texte
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
/* sortie log vers fichier texte */
ods listing file="i:\users\francois\tex\stat\SAS\html\sinus.txt";
proc print data=sinus(obs=10);run;
ods listing close;
/* réouverture sortie texte dans log */
ods listing;
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
45 / 63
Graphisme
Ods :sortie texte
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
[email protected]
The SAS System
15:26 Monday, January 19, 2004
Obs
X
Y
1
2
3
4
5
6
7
8
9
10
0.00
0.05
0.10
0.15
0.20
0.25
0.30
0.35
0.40
0.45
0.00000
0.00499
0.01987
0.04433
0.07788
0.11986
0.16939
0.22548
0.28694
0.35250
Statistiques, M2-IAD:MI5
13
5 octobre 2011
46 / 63
Graphisme
Ods : sortie pdf
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
/* sortie vers fichier pdf
*/
ods pdf file="i:\users\francois\tex\stat\SAS\html\sinus.pdf";
proc print data=sinus(obs=10);run;
ods pdf close;
quit;
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
47 / 63
Graphisme
Ods : sortie rtf
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
/* sortie vers fichier rtf
*/
ods rtf file="i:\users\francois\tex\stat\SAS\html\sinus.rtf";
proc print data=sinus(obs=10);run;
ods rtf close;
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
48 / 63
Graphisme
Ods : sortie html
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
/*
attention bug dans SAS v8.2 SAS.CFG
1- option -PATH mettre la ligne
sasaext0/dbcs/sasexe apres /sasroot/core/sasexe
2- options -NODBCS au lieu de DBCS
*/
data test;
x=1;y="bonjour ";output;
x=2;y="au revoir";output;
run;
/* sortie print -> html */
ods html body="i:\users\francois\tex\stat\SAS\html\test.htm";
proc print data=test;run;
ods html close;
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
49 / 63
Graphisme
Ods : graphique sortie html
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
/* sortie print graphique -> html */
filename output ’i:\users\francois\tex\stat\sas\html’;
goptions
device=html
/* driver html */
gsfname=output
/* répertoire de sortie fichiers graphiques*/
transparency
/* image gif en mode transparent */
noborder
/* pas de bordure */
;
title "pages html et graphique";
ods html
path=output
/* repertoire de sortie fichiers html */
body="index.htm" /* nom du fichier racine */
;
title1 "inclusion d un graphique";
proc gplot data=sinus;
plot y*x;
run;
title1 "inclusion d’un résultat";
proc means data=classe;
run;
ods html close;
quit;
goptions device=win;
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
50 / 63
Graphisme
Paragraphe
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
Introduction
Les options graphiques
Les symboles
Les axes
La procédure GPLOT
Les tables d’annotation
Fichiers graphiques
ods
Formats graphiques
La procédure greplay
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
51 / 63
Graphisme
goptions : graphique sortie ps
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
/* sortie graphique ps */
filename fichier "i:\users\francois\tex\stat\SAS\html\sinus.ps";
goptions device=pslepsfc gsfname=fichier;
proc gplot data=sinus;
plot y*x/
description="Essai Ps";
run;
quit;
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
52 / 63
Graphisme
goptions : graphique sortie png
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
/* sortie graphique png */
filename fichier "i:\users\francois\tex\stat\SAS\html\sinus.png";
goptions device=png gsfname=fichier;
proc gplot data=sinus;
plot y*x/
description="Essai Png";
run;
quit;
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
53 / 63
Graphisme
goptions : graphique sortie gif
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
/* sortie graphique gif */
filename fichier "i:\users\francois\tex\stat\SAS\html\test.gif";
goptions device=gif gsfname=fichier;
proc gplot data=sinus;
plot y*x/
description="Essai Gif";
run;
quit; /* fermeture des fichiers */
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
54 / 63
Graphisme
Paragraphe
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
Introduction
Les options graphiques
Les symboles
Les axes
La procédure GPLOT
Les tables d’annotation
Fichiers graphiques
ods
Formats graphiques
La procédure greplay
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
55 / 63
Graphisme
greplay
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
Le but de cette procédure est de traduire ou réunir différents
graphiques d’un même catalogue.
/* greplay */
filename psdir "I:\users\Francois\TEX\stat\SAS\ps";
goptions hsize=20cm vsize=20cm gsfname=psdir device=pslepsfc;
proc greplay igout=graphique nofs;
replay _ALL_;
run;
quit;
/* goptions reset */
goptions reset=all;
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
56 / 63
Graphisme
greplay
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
/* greplay */
filename psdir "I:\users\Francois\TEX\stat\SAS\ps";
goptions hsize=20cm vsize=20cm gsfname=psdir device=pslepsfc;
proc greplay igout=user.gseg nofs;
replay _LAST_;
run;
quit;
goptions reset=all;
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
57 / 63
Graphisme
greplay
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
/* greplay découper écran en 3 parties */
data table;
do x=0 to 10 by .01;
y1=x*sin(x);
y2=x**2*sin(x);
output;
end;
run;
symbol1 interpol=join; symbol2 interpol=join; symbol3 interpol=join;
proc gplot gout=figures;
plot y1*x /name=’y1_x’;
plot y2*x /name=’y2_x’;
plot y2*y1 /name=’y2_y1’;
run;
filename fichier "I:\users\francois\tex\stat\SAS\ps\gr-greplay-template.eps";
goptions gsfname=fichier device=pslepsfc;
proc greplay igout=figures nofs tc=SASHELP.TEMPLT template=H3;
treplay 1:’y1_x’ 2:’y2_x’ 3:’y2_y1’;
run;
quit;
goptions reset=all;
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
58 / 63
Graphisme
greplay
Introduction
goptions
Symbol
Axes
gplot
Annotate
Fichiers
ods
formats
greplay
y1
8
y2
70
y2
70
7
60
60
50
50
40
40
30
30
20
20
10
10
6
5
4
3
2
1
0
0
-10
-10
-20
-20
-30
-30
-40
-40
-5
-50
-50
-6
-60
0
-1
-2
-3
-4
0
1
2
3
4
5
x
[email protected]
6
7
8
9
10
-60
0
1
2
3
4
5
6
7
8
x
Statistiques, M2-IAD:MI5
9
10 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8
y1
5 octobre 2011
59 / 63
Index
Deuxième partie II
Index
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
60 / 63
Index
Index I
goptions
device
gif, 55
png, 54
ps, 53
greplay
all, 57
last, 58
Graphisme
annotate
exemple, 39
axis, 26
exemple, 27
g3d
exemple, 14
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
61 / 63
Index
Index II
gchart
exemple, 8
gmap
exemple, 10
goptions, 19
exemple, 16
option, 20
gplot
overlay, 35
greplay
exemple, 16
template, 59
scatterplot
exemple, 12
symbol, 22
exemple, 23
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
62 / 63
Index
Index III
ods
exemples
graphique, 51
html, 50
listing, 46
pdf, 48
rtf, 49
[email protected]
Statistiques, M2-IAD:MI5
5 octobre 2011
63 / 63

Documents pareils