************************************************************; * Cas barres ; * MDPREF : analyse INTERNE ; * Espace créé à partir des préférences produits ; * Puis projection des varaibles objectives ; * Pierre Desmet 2012 ; ***********************************************************; Title1 H=1 j=l "Etude Barres chocolatées"; Footnote1 H=1 j=l "Analyse sensorielle" j=r "Master Marketing. 2012" ; *****************************************************************************; * Espace perceptuel des barres chocolatées : variables objectives; *****************************************************************************; data objectif ; length descriptif $ 100. fab $ 10. marque $ 9. type $ 9.; input fab $ marque $ Cacao_100 Coco Nougat Caramel Nois_Cacahuet Cereales Chocolat Biscuit Gaufrettes Prix_lot Combien Poids_total Poids_u Prix_u Prix_kg Cal Cal_u Proteines_100 Glucides_100 G_sucres_100 G_autre_100 Lipides_100 Descriptif $; /* ne pas laisser d'espace dans le descriptif */ if chocolat=1 then type="Chocolat"; else if biscuit=1 then type="Biscuit"; else type="Gaufrette" ; /* attention : si couper/coller d'excel , penser à remplacer les '.' par des '.' */ cards; Nestlé Nuts 0 0 0 1 1 0 1 0 0 2.70 6 252 42.0 0.45 10.71 498 209 4.6 62.3 55.2 7.1 24.8 Chocolat_au_lait_fourrage_caramel_et_noisettes Mars Snickers 1 0 0 1 1 0 1 0 0 2.44 6 300 50.0 0.41 8.13 503 252 9.1 56.2 48.6 7.6 26.7 Chocolat_au_lait_100%_pur_beurre_de_cacao_fourré_de_confiserie_et_de_caramel_avec_des_cacahuètes_grillées Mars Mars 1 0 0 1 0 0 1 0 0 2.09 6 252 42.0 0.35 8.29 452 190 3.5 70.2 54.3 15.9 17.2 Chocolat_au_lait_100%_pur_beurre_de_cacao_fourré_de_confiserie_et_caramel Mars Milky_way 1 0 0 0 0 0 1 0 0 2.50 9 197 21.9 0.28 12.69 449 98 4 71.8 66.8 5 16.1 Chocolat_au_lait_100%_pur_beurre_de_cacao_fourré_de_mousse_dau_lait Mars Bounty 1 1 0 0 0 0 1 0 0 2.75 10 285 28.5 0.28 9.65 488 139 3.7 58.3 48 10.3 26.1 Chocolat_au_lait_100%_beurre_de_cacao_fourré_de_noix_de_coco_blanche_et_tendre Kraft Nougatti 0 0 1 0 0 0 1 0 0 3.99 9 270 30.0 0.44 14.78 470 141 6.2 57.5 56 1.5 24 Chocolat_au_lait_extra-fin_fourré_au_nougat Nestlé Lion 0 0 0 1 0 1 0 0 1 2.48 6 252 42.0 0.41 9.84 493 207 5.5 65.5 53.1 12.4 22.9 Gaufrette_fourrée_nappage_caramelisé_et_céréales_enrobage_chocolat_au_lait Ferrero Kinder 0 0 0 0 1 0 0 0 1 2.79 10 215 21.5 0.28 12.98 394 85 9.2 49.5 41.3 8.2 37.3 Fines_gaufrettes_enrobées_de_chocolat_au_lait_fourrées_lait_et_noisettes_broyées Nestlé Kit_Kat 0 0 0 0 0 0 0 0 1 2.14 6 270 45.0 0.36 7.93 522 235 7 60.2 49.4 10.8 27.6 Gaufrette_croustillante_enrobée_de_chocolat_au_lait Auchan Pouce 0 0 0 1 0 1 0 0 1 1.65 10 300 30.0 0.17 5.50 496 149 4.5 66 . . 23.5 Gaufrettes_et_riz_souflé_nappés_de_caramel_et_enrobées_de_chocolat_au_lait Nestlé Sundy 0 0 0 0 0 1 0 1 0 2.55 5 180 36.0 0.51 14.17 508 183 3.7 64.5 34.1 30.4 25.4 Barre_croustillante_de_céréales_au_chocolat Mars Balisto 1 0 0 0 0 1 0 1 0 2.10 9 166 18.4 0.23 12.65 503 93 7.4 60.3 43.8 16.5 25.1 Biscuit_aux_céréales_complètes__crème_et_fruit_des_bois_enrobage_avec_du_chocolat_au_lait_100%_pur_beurre_de_cacao Mars Twix 1 0 0 1 0 0 0 1 0 1.65 6 348 58.0 0.28 4.74 495 287 4.4 64.6 48.7 15.9 24 Biscuit_nappé_au_caramel_et_enrobé_avec_du_chocolat_au_lait_100%_pur_beurre_de_cacao ; run ; *****************************************************************************; * Variables nominales ; *****************************************************************************; /* tableau par marque */ Title2 'Tableau des variables nominales par marque'; Proc tabulate data=objectif ; class marque ; var cacao_100 Coco Nougat Caramel Nois_Cacahuet cereales Chocolat Biscuit Gaufrettes ; table marque, (Cacao_100 Coco Nougat Caramel Nois_Cacahuet cereales Chocolat Biscuit Gaufrettes)*(mean*F=4.0); run; /* tableau total : médiane et moyenne des variables quanti */ Title2 'Tableau des variables nominales : détermination de la médiane'; Proc tabulate data=objectif ; var Prix_lot Combien poids_total poids_u Prix_u Prix_kg cal cal_u Proteines_100 Glucides_100 G_sucres_100 G_autre_100 Lipides_100 ; table (Prix_lot Prix_u Prix_kg Combien poids_total poids_u cal cal_u Proteines_100 Glucides_100 G_sucres_100 G_autre_100 Lipides_100),(mean median); run; data objectif; set objectif ; if cal=. then cal_B=.; else if cal>495 then cal_B=1; else cal_B=0 ; if Proteines_100 =. then Proteines_B=. ; else if Proteines_100>4.6 then Proteines_B=1; else Proteines_B=0; if G_sucres_100=. then G_sucres_B=. ; else if G_sucres_100> 49 then G_sucres_B=1; else G_sucres_B =0; if G_autre_100 =. then G_autre_B=.; else if G_autre_100>10.55 then G_autre_B =1; else G_autre_B = 0; if Lipides_100=. then Lipides_B=. ; else if Lipides_100> 24.8 then Lipides_B=1; else Lipides_B = 0; run ; proc format ; value cal 0="CL-" 1="Calorie"; value Coco 0="CO-" 1="Coco"; value proteines 0="PR-" 1="protein" ; value lipides 0="LI-" 1="Lipide" ; value G_sucre 0="SU-" 1="Sucre" ; value G_autre 0="GA-" 1="Gluc_A" ; value cacao_100p 0="CA-" 1="Cacao100" ; value Nougat 0="NO-" 1="Nougat" ; value Caramel 0="CA-" 1="Caramel" ; value Nois_Cacahuet 0="NX- " 1="Nois_Cacah" ; value cereales 0="CE-" 1="Cereales" ; value Chocolat 0="CH-" 1="T_Chocolat" ; value Biscuit 0="BI-" 1="T_Biscuit" ; value Gaufrettes 0="G-" 1="T_Gaufrettes" ; run ; /* tableau discretisé complet */ Title2 'Tableau des variables nominales discrétisées par marque'; Proc tabulate data=objectif ; class marque ; var cacao_100 Nougat Caramel Nois_Cacahuet cereales Chocolat Biscuit Gaufrettes cal_B Proteines_B G_sucres_B G_autre_B Lipides_B; table marque, (cacao_100 Nougat Caramel Nois_Cacahuet cereales Chocolat Biscuit Gaufrettes cal_B Proteines_B G_sucres_B G_autre_B Lipides_B)*(mean*F=4.0); run; *****************************************************************************; * Analyse des préférences ; *****************************************************************************; data pref_in ; length code $ 10. pref1 $ 3. pref2 $ 3. pref3 $ 3. pref4 $ 3. pref5 $ 3. pref6 $ 3.; array ia{13} ia1-ia13; array na{13} na1-na13; array a{13} a1-a13; array ln{13} ln1-ln13; array r{6} r1-r6; array pref{6} pref1-pref6 ; array prefc{13} prefc1-prefc13 ; input CODE $ ia1 ia2 ia3 ia4 ia5 ia6 ia7 ia8 ia9 ia10 ia11 ia12 ia13 na1 a1 ln1 na2 a2 ln2 na3 a3 ln3 na4 a4 ln4 na5 a5 ln5 na6 a6 ln6 na7 a7 ln7 na8 a8 ln8 na9 a9 ln9 na10 a10 ln10 na11 a11 ln11 na12 a12 ln12 na13 a13 ln13 Pref1 $ pref2 $ pref3 $ pref4 $ pref5 $ Pref6 $ ; Do i =1 to 6; if pref{i}="MAR" then do ; prefc{1}=7-i;r{i}=1;end; else if pref{i}="NOU" then do ; prefc{2}=7-i;r{i}=2;end; else if pref{i}="SNI" then do ; prefc{3}=7-i;r{i}=3;end; else if pref{i}="MIL" then do ; prefc{4}=7-i;r{i}=4;end; else if pref{i}="SUN" then do ; prefc{5}=7-i;r{i}=5;end; else if pref{i}="BOU" then do ; prefc{6}=7-i;r{i}=6;end; else if pref{i}="NUT" then do ; prefc{7}=7-i;r{i}=7;end; else if pref{i}="TWI" then do ; prefc{8}=7-i;r{i}=8;end; else if pref{i}="LIO" then do ; prefc{9}=7-i;r{i}=9;end; else if pref{i}="BAL" then do ; prefc{10}=7-i;r{i}=10;end; else if pref{i}="KIT" then do ; prefc{11}=7-i;r{i}=11;end; else if pref{i}="BUE" then do ; prefc{12}=7-i;r{i}=12;end; else if pref{i}="POU" then do ; prefc{13}=7-i;r{i}=13;end; end; cards ; ST 4 1 2 1 1 1 1 2 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1 1 8 0 0 0 BUE MIL TWI KIT MAR . CL2206 4 1 2 1 1 1 1 5 4 3 4 2 1 1 1 8 0 0 0 1 0 6 0 0 0 0 0 0 1 0 2 1 0 7 1 1 8 1 1 9 1 1 6 1 1 7 1 1 8 0 0 0 LIO MAR BUE TWI KIT . VI 1 1 3 1 1 1 1 4 1 1 4 2 1 1 1 1 1 0 0 1 1 10 1 0 0 0 0 0 1 1 8 1 1 2 1 1 10 1 1 1 1 1 2 1 1 10 1 1 10 0 0 0 KIT BUE TWI SNI BOU . CAM 1 1 1 2 1 1 1 1 1 1 3 2 1 1 0 0 0 0 0 1 0 0 1 1 7 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 1 7 1 1 7 0 0 0 KIT MIL BUE . . . ; title2 'Impression de verification des données de préférence'; proc print data=pref_in ; var code ia1-ia13 ln1-ln13 pref1-pref6; run; ****************************************************; * construction d'un data_long ; ****************************************************; data preferences ; set pref_in ; keep code marque notoriete penetration liking rang intention ; length code $ 10. ; array ia{13} ia1-ia13; array na{13} na1-na13; array a{13} a1-a13; array ln{13} ln1-ln13; array prefc{13} prefc1-prefc13 ; array lib{13} $ 9. lib1-lib13 ; lib{1}="Mars"; lib{2}="Nougatti"; lib{3}="Snickers" ;lib{4}="Milky_way" ;lib{5}="Sundy"; lib{6}="Bounty";lib{7}="Nuts"; lib{8}="Twix" ;lib{9}="Lion";lib{10}="Balisto" ; lib{11}="Kit_Kat" ;lib{12} ="Kinder"; lib{13}="Pouce"; Do i=1 to 13 ; if prefc{i}=. then prefc{i}=0 ; marque= lib{i} ; notoriete=na{i}; penetration= a{i}; liking=ln{i} ; rang= prefc{i} ; intention=ia{i}; if notoriete=0 then do ; liking=0 ; rang=0 ;end; /* ou missing */ output ; end; title2 'Impression de verification dta_long (ind, marque)'; proc print data=preferences (obs=30); var code marque notoriete penetration liking rang intention; run; title2 'Tableau de la situation de chaque marque : notriété, pénétration, rang et intention'; proc tabulate data=preferences ; class marque ; var notoriete penetration liking rang intention ; table marque, (notoriete penetration)*mean liking*n*F=3.0 (rang intention)*mean ; run ; ****************************************************; * transposition de la matrice des "liking" ; ****************************************************; proc sort data=preferences ; by marque ;run ; proc transpose data=preferences out=T_pref name=Test prefix=juge; by marque ; var liking ; run; proc sort data=objectif ; by marque ;run ; data pref_all ; merge objectif T_pref (rename= (juge1=ST juge2=Francois juge3=OANA juge4=DRAGA juge5=ML87 juge6=AB88 juge7=AK007 juge8=SC07 juge9=CC juge10=MG juge11=XG1 juge12=CORTIAL juge13=GG2417 juge14=MLO3 juge15=LARACROFT juge16=STE juge17=CLO5 juge18=TWIX juge19=KIT juge20=PIMENTA juge21=A1604 juge22=ABAL juge23=EP juge24=AT juge25=JULIETTE juge26=CL2206 juge27=VI juge28=CAM )); by marque ; keep marque st--cam cacao_100 coco Nougat Caramel Nois_Cacahuet cereales Chocolat Biscuit Gaufrettes cal_B Proteines_B G_sucres_B G_autre_B Lipides_B; run ; title2 'Tableau complet des données transposées (liking)'; proc print data=pref_all (obs= 30); run ; **************************************************************************; * MDPREF phase 1 PrinQual : espace produit des préférences ; * Prinqual généralise l'analyse factorielle aux données nominales (qualitatives) ; **************************************************************************; title2 'MDPREF Phase 1 : Création de l"espace des préférences par Prinqual (quanti)'; ods graphics on ; proc prinqual data=pref_all plots=all maxiter= 100 n=2 out=P_pref standard scores correlations mdpref replace ; transform identity (st--cam); /* analyse métrique */ id marque cacao_100 Nougat Caramel Nois_Cacahuet cereales Chocolat Biscuit Gaufrettes cal_B coco Proteines_B G_sucres_B G_autre_B Lipides_B; /* garder les mesures */ run ; title 'Tableau P_Pref en sortie de Prinqual'; proc print data=P_Pref (obs= 30); run ; **************************************************************************; * MDPREF phase 2 (Analyse interne): transreg ; * Transreg généralise la régression aux variables ordinales ; **************************************************************************; * modèle vectoriel pour les variables dont les optima sont à l'infini; ods graphics on ; title2 'Carte des Préférences internes (MDPREF phase II): Modèle vectoriel (Mode Identity)'; Proc transreg data=P_Pref; model identity(cacao_100 Nougat Caramel Nois_Cacahuet cereales cal_B coco Chocolat Biscuit Gaufrettes Proteines_B G_sucres_B G_autre_B Lipides_B) =identity(Prin1 Prin2); output tstandard=center coordinates replace out=TResult1; id _NAME_; ods select PrefMapVecPlot ; Format cal_B cal. cacao_100 cacao_100p. Nougat nougat. Caramel caramel. cereales cereales. Chocolat chocolat. Biscuit biscuit. Nois_Cacahuet Nois_Cacahuet. Gaufrettes gaufrettes. Proteines_B proteines. G_sucres_B G_sucre. G_autre_B G_autre. Lipides_B lipides. coco coco.; run; * modèle point idéal pour la conduite (optimum fini); title2 'Carte des Préférences internes (MDPREF phase II) : Modèle point idéal (Mode Point)'; Proc transreg data=P_Pref; model identity(cacao_100 Nougat Caramel Nois_Cacahuet cereales cal_B coco Chocolat Biscuit Gaufrettes Proteines_B G_sucres_B G_autre_B Lipides_B) =point(Prin1 Prin2); output tstandard=center coordinates replace noscores out=TResult2; id _NAME_; ods select PrefMapIdealPlot ; Format cal_B cal. cacao_100 cacao_100p. Nougat nougat. Caramel caramel. cereales cereales. Chocolat chocolat. Biscuit biscuit. Nois_Cacahuet Nois_Cacahuet. Gaufrettes gaufrettes. Proteines_B proteines. G_sucres_B G_sucre. G_autre_B G_autre. Lipides_B lipides. coco coco.; run;