/* PROG 1 : Opération IPhone */ *DEBUT DE MON PROGRAMME; ************************; options formdlim="-"; TITLE H=3 J=L "Opération IPhone"; TITLE1 H=2 J=L "Tests non paramétriques"; TITLE3 H=3 ; FOOTNOTE1 H=2 J=L "Master Marketing Paris-Dauphine"; FOOTNOTE2 H=1 J=L "SOURCE : Analyse des données appliquée au marketing" J=R "(c)2007 Pierre DESMET"; DATA IN ; INPUT Q01-Q11 Q12 $; IF Q12="H" THEN Q13=0; ELSE IF Q12="F" THEN Q13=1; ELSE Q13=.; Q05=Q05/10; * 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 10 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"; title2 ; * annule le title2 précédent; ******************************************************************; * McNEMAR ; ******************************************************************; Proc format ; value q10fmt 0-100='Négatif' 101-High="Positif"; value q11fmt 1-2="Négatif" 3-7="Positif"; Proc freq data=in; tables Q10*Q11/ nocol nopct AGREE; format Q10 q10fmt. Q11 Q11fmt.; title3 h=3'test de Mc Nemar avant/après J&J, p. 223'; title4 h=2 'FREQ avec option "agree" '; *****************************************************************; *=================================================================; * Est-ce que les femmes sont prêtes à payer plus pour un Iphone ? ; *=================================================================; ******************************************************************; * exploration par tabulate, freq ; ******************************************************************; proc tabulate data=in ; class q13; var q10 ; table q10, q13*(N mean); format q13 genrefmt. ; title2 h=3 J=L 'Est-ce que les femmes sont prêtes à payer plus pour un Iphone ?'; title3 h=3 'Exploration par Tabulate '; proc freq data=in; tables Q10*Q13 / nopct nocol norow cumcol; format q13 genrefmt. ; title3 h=3 'exploration par Freq'; ******************************************************************; * Kolomogorov-Smirnov ; ******************************************************************; proc Npar1way data=in edf KS ; class Q13; var Q10; format q13 genrefmt. ; title3 h=3 'test de Kolmogorov-Smirnov J&J, p. 224'; title4 h=2 'NPAR1WAY avec option "edf KS " '; ******************************************************************; * test du signe (median) et Wilcoxon ; ******************************************************************; proc Npar1way data=in median wilcoxon; class Q13; var Q10; exact wilcoxon ; * si echantillon de faible taille ; format q13 genrefmt. ; title3 h=3 'test de la médiane (direction) et de Wilcoxon (direction et amplitude) J&J, p. 227-228'; title4 h=2 'NPAR1WAY avec option "Median Wilcoxon" '; * utilisation d'une FREQ pour sortir des pourcentages ; *****************************************************; proc sort data=in; by q13; proc freq data=in noprint; by q13; tables Q10 / out=in_pct OUTPCT OUTCUM; proc print data=in_pct (obs=3); proc gplot data=in_pct ; axis1 label=('Prix prêt à payer' justify =right) order= (0 to 400 by 50) length= 10cm ; axis2 label=('Effectifs' justify =right 'Cumulés') order=(0 to 100 by 10) ; symbol1 interpol=stepj value=circle; plot cum_pct*q10=Q13 / haxis=axis1 vaxis=axis2 hminor=4 vminor=0; format q13 genrefmt.; run; title3 H=3 'Graphique cumulé ascendant'; title4 ; ******************************************************************; * 'test de relation entre variables nominales par FREQ'; ******************************************************************; symbol1 interpol=none value=circle; proc gplot data=in; plot q01*q05; title2 J=L H=3 'Quelle corrélation entre nb heures téléphone mobile et nb heures internet ?'; title3 H=3 'exploration par Gplot '; proc freq data=in; tables q01 q05; title3 h=3 'Test de relation entre variables nominales par FREQ'; Proc format ; value q01fmt 0-1='0-1' 2='2' 3='3' 4-High="4 et+"; value q05fmt 0-1="jusqu'à 1h" 1.01-1.5='1h01 à 1h30' 1.501-2.99='1h31 à 2h59' 3-high="3h0 et +"; Proc freq data=in; tables Q01*Q05/ nocol nopct chisq exact; format Q01 q01fmt. Q05 Q05fmt.; title3 h=3 'hyp variables nominales Chi2 J&J, p. 217-218'; title4 h=2 'FREQ avec option "CHISQ" '; ******************************************************************; * 'test de corrélation des rangs par FREQ'; ******************************************************************; Proc freq data=in; tables Q01*Q05/ nocol nopct cl measures ; format Q01 q01fmt. Q05 Q05fmt.; title3 h=3 'hyp variables ordinales Spearman J&J, p. 225-226'; title4 h=2 'FREQ avec option "measures" '; ******************************************************************; * SPEARMAN ; ******************************************************************; proc corr data=in spearman; var q01 q05 ; title3 h=2 'test de corrélation des rangs par CORR';