************************************************************; * Cas barres ; * espace perceptuel non pré défini ; * 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 (non structuré); *****************************************************************************; Title2 h=2 'Espace perceptuel des barres chocolatées (non structuré)'; data in ; length horiz $ 20. vert $ 20. ; input Groupe $ x1 y1 x2 y2 x3 y3 x4 y4 x5 y5 x6 y6 x7 y7 x8 y8 x9 y9 x10 y10 x11 y11 x12 y12 x13 y13 horiz $ vert $ ; cards; G1 6 -5 -7 6 7 -1 -12 -8 11 2 -10 -6 -3 1 0 5 -11 3 12 5 3 7 4 3 6 3 plaisir_energie tendre_croustillant G2 6 3 1 2 -2 7 7 -5 -1 -8 6 3 14 9 -5 6 4 7 -9 -7 -14 1 -12 4 -9 -3 croustillant_moelleux calorique G3 -11 5 -2 -1 -5 4 -8 0 12 -6 -10 -6 -6 -1 5 3 10 3 6 -6 1 8 0 2 5 6 mou_croquant chocolate G4 7 8 6 0 -3 0 -13 9 -6 -7 -13 -5 -6 -9 -4 8 7 4 -2 -9 -11 -9 -9 6 -9 4 amer_sucre croustillant_fondant G5 12 -7 12 9 4 1 -2 -2 -11 8 -8 -9 -8 -1 7 5 7 -2 -13 6 9 9 -3 5 7 3 chocolat croustillant G6 7 6 11 -3 -2 1 -11 -6 8 -2 -6 0 4 -2 2 5 0 7 13 -5 5 3 11 9 -8 -8 enfant_adulte bas_haut_gamme G7 8 -6 5 1 10 3 -9 -6 -3 8 -10 -3 -2 5 9 6 5 7 -3 7 12 8 3 8 7 5 chocolat croustillant_fondant G8 8 7 0.5 -3 11 5 -11 -5 6 -7 -11 3 3 -1 0 6 1 8 2 1 -7 7 -13 7 -1 -9 plaisir_energie notoriete G9 5 6 -10 1 -2 5 12 -1 -10 -3 -1 5 -2 3 3 3 7 4 -6 1 12 4 12 6 4 -6 pas_de_nom cherte ; proc print data=in ; var groupe horiz vert ;run ; proc format ; value barrefmt 1="Mars" 2="Nougatti" 3="Snickers" 4="Milky_way" 5="Sundy" 6="Bounty" 7="Nuts" 8="Twix" 9="Lion" 10="Balisto" 11="Kit_Kat" 12="Kinder" 13="Pouce" ; run ; *****************************************************************************; * Représentation graphique des matrices brutes par groupe ; *****************************************************************************; data in_long ; set in ; keep groupe marque ID x0 y0 ; length ID $ 9.; array x{13} x1-x13 ; array y{13} y1-y13 ; 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; X0 = x{i}; y0= Y{i}; marque=i ; ID=lib{i} ;output ; end; run; data work ; set in_long ; X=X0 ; Y=Y0; text=ID ; /* variable d'identification */ size=1; xsys='2'; ysys='2'; Label Y='Dim 2' X='Dim 1'; /* nom des axes */ keep X Y Xsys Ysys text size groupe ; run; proc gplot data=work; symbol1 V=none interpol=none; by groupe ; plot Y*X=1 / haxis=axis1 vaxis=axis2 annotate=work Frame Href=0 Vref=0; run; *****************************************************************************; * Espace produit à partir des données de similarité ; * 1. Calcul d'une matrice de similarité ordinale une ligne par marque; *****************************************************************************; data in_mds; set in ; keep groupe i j dist ; array x{13} x1-x13 ; array y{13} y1-y13 ; do i=1 to 13; do j=1 to 13 ; dist = (x[i}-x{j})**2 + (y[i}-y{j})**2 ; output ; end; end; proc rank data=in_mds out=in_mds_rang ties= low; by groupe i ; var dist ; ranks r_dist ; run ; data in_mds_2 ; set in_mds_rang ; retain groupe i d1-d13; keep groupe i d1-d13; array d{13} d1-d13; d{j}=r_dist-1 ; if j=13 then output ; run ; Title2 h=2 'Matrices de similarités par groupe'; proc print data=in_mds_2 (obs= 26);run ; *****************************************************************************; * Espace produit à partir des données de similarité ; * 2. Recherche d'une configuration pour un groupe ; *****************************************************************************; data in_mds_3 ; set in_mds_2 ; where groupe="G1" ; /* déactiver pour plusieurs groupes */ run ; title2 'MDS non métrique : espace commun à plusieurs groupes '; ods graphics on; proc mds data=in_mds_3 (drop= groupe i ) condition=row /* les données sont structurées par ligne */ level=ordinal /* les données sont un ordre */ coef=diagonal dimension=3 /*rechercher un espace en 3 dimensions */ pfinal out=mds_out /* sortie d'un fichier des coordonnées */; * subject groupe; run; ods graphics off; Title2 h=2 'Données de sortie du MDS'; proc print data=mds_out ;run ; data mds_out ; set mds_out ; keep marque Dim1 Dim2 ; where _NAME_ NE "" ; length marque $ 9. ; if _NAME_="d1" then marque="Mars"; else if _NAME_="d2" then marque="Nougatti" ; else if _NAME_="d3" then marque="Snickers" ; else if _NAME_="d4" then marque="Milky_way" ; else if _NAME_="d5" then marque="Sundy" ; else if _NAME_="d6" then marque="Bounty"; else if _NAME_="d7" then marque="Nuts" ; else if _NAME_="d8" then marque="Twix" ; else if _NAME_="d9" then marque="Lion" ; else if _NAME_="d10" then marque="Balisto"; else if _NAME_="d11" then marque="Kit_Kat" ; else if _NAME_="d12" then marque="Kinder" ; else if _NAME_="d13" then marque="Pouce" ; run ; Title2 h=2 'Données de sortie du MDS avec les marques'; proc print data=mds_out ;run ; data work ; set mds_out ; X=Dim1 ; Y=Dim2; text=marque ; /* variable d'identification */ size=1; xsys='2'; ysys='2'; Label Y='Dim 2' X='Dim 1'; /* nom des axes */ keep X Y Xsys Ysys text size ; run; Title2 h=2 'Graphique de l"espace des produits par MDS sur les groupes'; proc gplot data=work; symbol1 V=none interpol=none; plot Y*X=1 / annotate=work Frame Href=0 Vref=0; run; *****************************************************************************; * Espace produit à partir des données de similarité ; * 3. Recherche d'un espace commun des représentations pour plusieurs groupes; *****************************************************************************; data in_mds_3 ; set in_mds_2 ; * where groupe="G1" ; /* déactiver pour plusieurs groupes */ run ; title2 'MDS non métrique : espace commun à plusieurs groupes '; ods graphics on; proc mds data=in_mds_3 (drop= groupe i ) condition=row /* les données sont structurées par ligne */ level=ordinal /* les données sont un ordre */ coef=diagonal dimension=3 /*rechercher un espace en 3 dimensions */ pfinal out=mds_out /* sortie d'un fichier des coordonnées */; * subject groupe; run; ods graphics off; Title2 h=2 'Données de sortie du MDS'; proc print data=mds_out ;run ; data mds_out ; set mds_out ; keep marque Dim1 Dim2 ; where _NAME_ NE "" ; length marque $ 9. ; if _NAME_="d1" then marque="Mars"; else if _NAME_="d2" then marque="Nougatti" ; else if _NAME_="d3" then marque="Snickers" ; else if _NAME_="d4" then marque="Milky_way" ; else if _NAME_="d5" then marque="Sundy" ; else if _NAME_="d6" then marque="Bounty"; else if _NAME_="d7" then marque="Nuts" ; else if _NAME_="d8" then marque="Twix" ; else if _NAME_="d9" then marque="Lion" ; else if _NAME_="d10" then marque="Balisto"; else if _NAME_="d11" then marque="Kit_Kat" ; else if _NAME_="d12" then marque="Kinder" ; else if _NAME_="d13" then marque="Pouce" ; run ; Title2 h=2 'Données de sortie du MDS avec les marques'; proc print data=mds_out ;run ; data work ; set mds_out ; X=Dim1 ; Y=Dim2; text=marque ; /* variable d'identification */ size=1; xsys='2'; ysys='2'; Label Y='Dim 2' X='Dim 1'; /* nom des axes */ keep X Y Xsys Ysys text size ; run; Title2 h=2 'Graphique de l"espace de compromis des produits par MDS sur les groupes'; proc gplot data=work; symbol1 V=none interpol=none; plot Y*X=1 / annotate=work Frame Href=0 Vref=0; run; *****************************************************************************; * Espace perceptuel des barres chocolatées (non structuré); *****************************************************************************; data objectif ; length descriptif $ 100. fab $ 10. marque $ 9. type $ 9.; input fab $ marque $ cacao_100 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 à remplacer les '.' par des '.' si couper/coller d'excel */ cards; Nestlé Nuts 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 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 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 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 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 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 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 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 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 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 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 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 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 ; Title2 h=2 'Données objectives : Fabriquant'; proc print data=objectif ; var Marque Fab descriptif ; run ; Title2 h=2 'Données objectives : Lot et Prix'; proc print data=objectif ; var Marque Prix_lot Combien poids_total poids_u Prix_u Prix_kg ; run ; Title2 h=2 'Données objectives : proteines, glucides, lipides'; proc print data=objectif ; var Marque cal cal_u Proteines_100 Glucides_100 G_sucres_100 G_autre_100 Lipides_100 ; run ; Title2 h=2 'Données par type : proteines, glucides, lipides'; proc tabulate data=objectif ; class type ; var cal cal_u Proteines_100 Glucides_100 G_sucres_100 G_autre_100 Lipides_100 ; table (cal cal_u Proteines_100 Glucides_100 G_sucres_100 G_autre_100 Lipides_100)*(min max mean)*F=4.0, type; run ; Title2 h=2 'Données par type : Prix '; proc tabulate data=objectif ; class type ; var Prix_lot Combien poids_total poids_u Prix_u Prix_kg ; table (Prix_lot Combien poids_total poids_u Prix_u Prix_kg)*(min max mean)*F=4.1, type; run ; proc sort data=objectif; by marque; run ; *****************************************************************************; * Traitement des Variables quantitatives par ACP ; *****************************************************************************; /* tableau par marque */ Title2 'Barres chocolatées : variables quantitatives par marque'; Proc tabulate data=objectif ; class marque ; 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 marque, (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)*(mean); run; /* tableau par fabriquant * marque */ Title2 'Barres chocolatées : variables quantitatives par fabriquant * marque'; Proc tabulate data=objectif ; class fab marque ; 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 fab*marque, (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)*(mean); run; ods graphics on ; ********************************; * exploration ; ********************************; Title2 'ACP des barres chocolatées (variables quanti): exploration'; proc corr 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 ; run ; proc factor data=objectif n=4 rotate=varimax; 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 ; run ; ****************************************************; * sélection des variables et choix du nombre d'axes ; ****************************************************; Title2 'ACP des barres chocolatées (variables quanti): variables à choisir'; proc factor data=objectif msa rotate=varimax n=2 out=obj_factor plots=all ; var Proteines_100 G_sucres_100 G_autre_100 Lipides_100 ; run ; data work ; set obj_factor ; X=Factor1; Y=factor2; size=1; xsys='2'; ysys='2'; Label Y='Dim 2' X='Dim 1'; text=marque ; keep X Y Xsys Ysys text size ; run; proc gplot data=work; symbol1 V=none interpol=none; plot Y*X=1 / haxis=axis1 vaxis=axis2 annotate=work Frame Href=0 Vref=0; run; *****************************************************************************; * Variables nominales ; *****************************************************************************; Title2 'Espace perceptuel des barres chocolatées (variables nominales)'; /* tableau par marque */ Title2 'Tableau des variables nominales par marque'; Proc tabulate data=obj_factor ; class marque ; var cacao_100 Nougat Caramel Nois_Cacahuet cereales Chocolat Biscuit Gaufrettes ; table marque, (cacao_100 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=obj_factor ; 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 Combien poids_total poids_u Prix_u Prix_kg cal cal_u Proteines_100 Glucides_100 G_sucres_100 G_autre_100 Lipides_100),(mean median); run; data obj_factor; set obj_factor ; 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="C-" 1="Cal+"; value proteines 0="P-" 1="pro+" ; value lipides 0="L-" 1="Lip+" ; value G_sucre 0="S-" 1="Suc+" ; value G_autre 0="G-" 1="GA+" ; 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=" " 1="T_Chocolat" ; value Biscuit 0=" " 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=obj_factor ; 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; ods graphics on ; ********************************; * exploration ; ********************************; Title2 'Espace perceptuel des barres chocolatées (variables nominales) : exploration'; proc corresp data=obj_factor DIMENS=4 ; Tables marque, cacao_100 Nougat Caramel Nois_Cacahuet cereales Chocolat Biscuit Gaufrettes cal_B Proteines_B G_sucres_B G_autre_B Lipides_B; Format cal_B cal. cacao_100 cacao_100p. Nougat nougat. Caramel caramel. Nois_Cacahuet Nois_Cacahuet. cereales cereales. Chocolat chocolat. Biscuit biscuit. Gaufrettes gaufrettes. Proteines_B proteines. G_sucres_B G_sucre. G_autre_B G_autre. Lipides_B lipides.; run ; ****************************************************; * sélection des variables et choix du nombre d'axes ; ****************************************************; Title2 'Espace perceptuel des barres chocolatées (variables nominales) : variables choisies'; proc corresp data=obj_factor OUTC=obj_cor (rename= (_NAME_=marque)) DIMENS=2 ; Tables marque, cacao_100 cereales Chocolat Biscuit Gaufrettes cal_B Proteines_B G_sucres_B G_autre_B Lipides_B; Format cal_B cal. cacao_100 cacao_100p. Nougat nougat. Caramel caramel. Nois_Cacahuet Nois_Cacahuet. cereales cereales. Chocolat chocolat. Biscuit biscuit. Gaufrettes gaufrettes. Proteines_B proteines. G_sucres_B G_sucre. G_autre_B G_autre. Lipides_B lipides.; run ; proc sort data=obj_cor; by marque; run ; data objectif_cor ; merge obj_factor obj_cor ; by marque ; If _TYPE_="OBS" ; run ; Title2 'Obj_Cor : Tableau de sortie de l"AFACO'; proc print data=objectif_cor ; run ; Title2 'Graphique de sortie de l"AFACO'; data work ; set objectif_cor ; X=dim1; Y=dim2; size=1; xsys='2'; ysys='2'; Label Y='Dim 2' X='Dim 1'; text=Marque ; keep X Y Xsys Ysys text size _TYPE_; run; * axis1 length=17 cm order=(-15 to 15 by 1); * axis2 length=17 cm order=(-15 to 15 by 1); proc gplot data=work; symbol1 V=none interpol=none; * where _TYPE_="OBS"; plot Y*X=1 / haxis=axis1 vaxis=axis2 annotate=work Frame Href=0 Vref=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 3 1 3 2 2 1 1 8 0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L 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 ; title2 'Calcul des moyenens par marque'; proc sort data=preferences ; by marque ; run ; proc means data=preferences noprint ; by marque ; var notoriete penetration liking rang intention ; output out= pref_mean mean= m_notoriete m_penetration m_liking m_rang m_intention; run ; title2 'Graphique : notoriété * pénétration '; data work ; set pref_mean ; X=m_notoriete; Y=m_penetration; size=1; xsys='2'; ysys='2'; Label Y='Penetration' X='Notoriete'; text=Marque ; keep X Y Xsys Ysys text size _TYPE_; run; proc gplot data=work; symbol1 V=none interpol=none; plot Y*X=1 / annotate=work Frame Href=0 Vref=0; run; title2 'Graphique : notoriété * liking '; data work ; set pref_mean ; X=m_notoriete; Y=m_liking; size=1; xsys='2'; ysys='2'; Label Y='Liking' X='Notoriete'; text=Marque ; keep X Y Xsys Ysys text size _TYPE_; run; proc gplot data=work; symbol1 V=none interpol=none; plot Y*X=1 / annotate=work Frame Href=0 Vref=0; run; title2 'Graphique : Intention d"achat * liking '; data work ; set pref_mean ; X=m_liking; Y=m_intention; size=1; xsys='2'; ysys='2'; Label Y='Intention achat' X='Liking'; text=Marque ; keep X Y Xsys Ysys text size _TYPE_; run; proc gplot data=work; symbol1 V=none interpol=none; plot Y*X=1 / annotate=work Frame Href=0 Vref=0; 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; data pref_all ; merge objectif_cor 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 dim1 dim2 st--cam cacao_100 Nougat Caramel Nois_Cacahuet cereales Chocolat Biscuit Gaufrettes cal_B Proteines_B G_sucres_B G_autre_B Lipides_B; if _TYPE_="OBS" ; run ; title2 'Tableau complet des données transposées (liking)'; proc print data=pref_all ; run ; **************************************************************************; * Projection des préférences sur l'espace des produits (correspondances ) ; **************************************************************************; * modèle vectoriel pour les variables dont les optima sont à l'infini; ods graphics on ; title2 'Carte des Préférences superposée sur les correspondances : Modèle vectoriel '; Proc transreg data=pref_all; model identity(st--cam )=identity(Dim1 Dim2); /* identity = identity */ output tstandard=center coordinates replace out=TResult1; id marque; ods select PrefMapVecPlot ; Format cal_B cal. cacao_100 cacao_100p. Nougat nougat. Caramel caramel. Nois_Cacahuet Nois_Cacahuet. cereales cereales. Chocolat chocolat. Biscuit biscuit. Gaufrettes gaufrettes. Proteines_B proteines. G_sucres_B G_sucre. G_autre_B G_autre. Lipides_B lipides.; run; * modèle point idéal pour la conduite (optimum fini); title2 'Carte des Préférences superposée sur les correspondances: Modèle point idéal'; Proc transreg data=pref_all; model identity(st--cam)=point(Dim1 Dim2); output tstandard=center coordinates replace noscores out=TResult2; id marque; ods select PrefMapIdealPlot ; Format cal_B cal. cacao_100 cacao_100p. Nougat nougat. Caramel caramel. Nois_Cacahuet Nois_Cacahuet. cereales cereales. Chocolat chocolat. Biscuit biscuit. Gaufrettes gaufrettes. Proteines_B proteines. G_sucres_B G_sucre. G_autre_B G_autre. Lipides_B lipides.; run; **************************************************************************; * PREFMAP phase 1 PrinQual : espace produit des préférences ; * Prinqual généralise l'analyse factorielle aux données nominales (qualitatives) ; **************************************************************************; title2 'PREFMAP 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 Dim1 Dim2 cacao_100 Nougat Caramel Nois_Cacahuet cereales Chocolat Biscuit Gaufrettes ; /* garder les mesures */ run ; title 'Tableau P_Pref en sortie de Prinqual'; proc print data=P_Pref ; * where _TYPE_ ="CORR" ; run ; **************************************************************************; * PREFMAP phase 2 (Analyse externe): 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 (PREFMAP): Modèle vectoriel (Mode Identity)'; Proc transreg data=P_Pref; model identity(cacao_100 Nougat Caramel Nois_Cacahuet cereales Chocolat Biscuit Gaufrettes )=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. Nois_Cacahuet Nois_Cacahuet. cereales cereales. Chocolat chocolat. Biscuit biscuit. Gaufrettes gaufrettes. Proteines_B proteines. G_sucres_B G_sucre. G_autre_B G_autre. Lipides_B lipides.; run; * modèle point idéal pour la conduite (optimum fini); title2 'Carte des Préférences (PREFMAP) : Modèle point idéal (Mode Point)'; Proc transreg data=P_Pref; model identity(cacao_100 Nougat Caramel Nois_Cacahuet cereales Chocolat Biscuit Gaufrettes)=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. Nois_Cacahuet Nois_Cacahuet. cereales cereales. Chocolat chocolat. Biscuit biscuit. Gaufrettes gaufrettes. Proteines_B proteines. G_sucres_B G_sucre. G_autre_B G_autre. Lipides_B lipides.; run;