/* PROG 1 : Opération IPhone */ *DEBUT DE MON PROGRAMME; ************************; TITLE1 H=3 J=L "Opération IPhone"; TITLE2 H=2 J=L "Sorties graphiques GPLOT"; TITLE3 ; FOOTNOTE1 H=2 J=L "Master Marketing Paris-Dauphine"; FOOTNOTE2 H=1 J=L "SOURCE : 2007 ANALYSE DES DONNEES MARKETING" J=R "(c) Pierre DESMET"; DATA IN ; INPUT Q01-Q11 Q12 $; IF Q12="H" THEN Q13=0; ELSE IF Q12="F" THEN Q13=1; ELSE Q13=.; * création d'une intention d'achat binaire si Q11 = 3 ou plus; IF Q11=>3 then IA=1; else IA=0; * création d'une variable ecran_tactile ; IF Q07=3 then ecran_tactile=1; else ecran_tactile = 0; LABEL Q01="Nh heures de forfait telephone mobile" Q02="Budget mensuel telephone mobile" Q03="Abonnement MMS" Q04="Si oui, combien envoyes par mois" Q05="Nb heures par jour sur internet" Q06="Satisfaction mobile actuel" Q07="Quelle interface preferez vous : clavier, stylet, ecran tactile ?" Q08="CHOIX2" Q09="CHOIX3" Q10="Combien seriez vous pret a payer pour un Iphone" Q11="Intention d’achat de l’Iphone à 429 euros (1 à 7)" Q12="GENRE" IA="Intention d'achat binaire" ecran_tactile="Interface préférée = écran tactile"; CARDS; 4 35 1 0 15 2 1 3 2 200 1 F 3 50 0 0 15 3 1 3 2 200 3 F 4 45 0 0 20 3 1 3 2 50 1 H 4 55 1 3 20 2 2 3 1 350 6 F 4 55 0 0 20 5 1 2 3 200 1 F 4 60 1 1 40 5 1 3 2 150 1 H 3 40 0 0 20 6 2 3 1 50 2 H 4 50 0 0 30 6 1 3 2 50 1 F 2 40 0 0 20 7 1 2 3 0 1 F 0 20 0 0 30 1 1 3 2 10 1 H 3 45 0 0 1 7 1 2 3 70 1 F 2 28 0 0 10 5 1 2 3 50 1 F 1 15 0 0 10 5 1 2 3 50 1 F 1 25 0 0 10 6 1 3 2 150 1 F 0 30 0 0 30 3 3 1 2 200 1 F 4 50 1 3 10 5 1 3 2 250 3 H 4 48 0 0 30 5 1 3 2 200 2 F 2 35 1 0 20 5 1 3 2 100 3 F 12 50 0 0 15 6 1 3 2 250 3 F 3 55 0 0 20 5 2 1 3 150 1 F 4 60 1 0 20 6 1 2 3 150 1 F 3 50 0 0 10 5 1 3 2 150 1 F 3 35 0 0 20 6 3 1 2 50 1 F 2 18 0 0 15 3 3 1 2 200 1 F 2 35 0 0 15 6 1 3 2 75 1 F 4 50 1 1 20 6 1 3 2 10 1 F 4 40 0 0 30 7 2 3 1 300 5 H ; PROC FORMAT; VALUE MMSFMT 0="NON" 1="OUI"; VALUE GENREFMT 0="HOMME" 1="FEMME"; VALUE FMTA 1="TRES INSATISFAIT" 2="INSATISFAIT" 3="PLUTOT INSATISFAIT" 4="NI SATISFAIT NI INSATISFAIT" 5="PLUTOT SATISFAIT" 6="SATISFAIT" 7="TRES SATISFAIT"; VALUE FMTB 1-3="INSATISFAIT" 4="NE SAIT PAS" 5-7="SATISFAIT"; VALUE FORFAIT4FMT 0-3="Moins de 4 heures" 4-High="4 H et plus"; proc freq data=in noprint; tables Q02 / out=in_pct OUTCUM ; data in_pct ; set in_pct ; densite = percent / 100; repartition= cum_pct / 100; proc print data=in_pct ; *===============================================; * Variable quantitative DISCRETE : diagramme en bâtons ; *===============================================; TITLE4 H=2 "Diagramme en bâtons"; Proc GPLOT data=in_pct ; axis1 label=('Budget mensuel mobile') ; axis2 label=('Effectifs'); symbol1 interpol=needle value=dot ; * une aiguille avec un point au bout ; *************************************; Plot count*q02 / haxis=axis1 vaxis=axis2 hminor=4 vminor=0; run; *===============================================; * Variable quantitative DISCRETE : diagramme cumulatif ; *===============================================; TITLE4 H=2 "Diagramme cumulatif"; Proc GPLOT data=in_pct ; axis1 label=('Budget mensuel mobile' justify=right ) order=(10 to 70 by 5); axis2 label=('Effectifs cumulés') order=(0 to 30 by 5) length= 15cm ; symbol1 interpol=stepj value=none ; * en marches d'escalier (step), mais avec un lien (stepj) sans symbole ; ***********************************************************************; Plot cum_freq*q02 / haxis=axis1 vaxis=axis2 hminor=4 vminor=0; run; *===============================================; * Variable quantitative CONTINUE : fonction répartition (cumul) ; *===============================================; TITLE4 H=2 "Fonction de répartition"; Proc GPLOT data=in_pct ; axis1 label=('Budget mensuel mobile' justify=right ) order=(10 to 70 by 5); axis2 label=('Pourcentages cumulés') order=(0 to 100 by 5) length= 15cm ; symbol1 interpol=join value=dot ; * points joints - attention pourcentage de 0 à 100 (et non 1) ; ************************************************************; Plot cum_pct*q02 / haxis=axis1 vaxis=axis2 hminor=4 vminor=0; run; *===============================================; * Variable CONTINUE : histogramme ; *===============================================; TITLE4 H=2 "Histogramme"; Proc GPLOT data=in_pct ; axis1 label=('Budget mensuel mobile' justify=right ) order=(10 to 70 by 5); axis2 label=('%') order=(0 to .4 by .1) length= 15cm ; symbol1 interpol=steprj value=none ; * ; ************************************************************; pattern1 value=msolid ; * coloration de la barre ; Plot densite*q02 / haxis=axis1 vaxis=axis2 areas=1 hminor=4 vminor=0; run; *===============================================; * à deux dimensions ; *===============================================; TITLE4 H=2 "2 dimensions par GPLOT"; axis1 length=12cm offset=(2cm, 2cm); * OFFSET = décalage du graphique ; axis2 length=10cm ; symbol1 interpol=box ; Proc GPLOT data=in ; Plot q02*q13=1 / haxis=axis1 vaxis=axis2 hminor=0 vminor=2; format Q13 genrefmt.; run; TITLE4 H=2 "2 dimensions par BOXPLOT"; proc sort data=in ; by q13; Proc Boxplot data=in; Plot q02*q13 / notches haxis=axis1 vaxis=axis2 hminor=0 vminor=2; run;