*********************************************************;

* SUPERBOWL                                             *:

* données : perceptions de 3 marques                    *;

* échelle de 1 à 7 ne convient pas du tout / tout à fait*;

*********************************************************;

 

Data C_7 ;*** carte 7 ***;

* infile "D:/Travail/Cours/Cas/super bowl/DATA.C07.txt";

 

keep resp brand w rating1-rating27 ;

 

array rating{27} rating1-rating27 ;

array ratings1_{27} ratings1_1-ratings1_27 ;

array ratings2_{27} ratings2_1-ratings2_27 ;

array ratings3_{27} ratings3_1-ratings3_27 ;

 

input             card 1-2 resp 3-6

                  brand_1  7- 9 (ratings1_1-ratings1_27) (1.)

                  brand_2 37-39 (ratings2_1-ratings2_27) (1.)

                  brand_3 67-69 (ratings3_1-ratings3_27) (1.) ;

 

      w=1;

      brand = brand_1 ;

      do i=1 to 27 ;

            rating{i}=ratings1_{i} ;    

      end ;

      w=1;

      brand = brand_2 ;

      do i=1 to 27 ;

            rating{i}=ratings2_{i} ;    

      end ;

      w=1;

      brand = brand_3 ;

      do i=1 to 27 ;

            rating{i}=ratings3_{i} ;    

      end ;

 

     

      if brand ne . and brand ne 9 then output ;

label

rating1 ="C_Easy to rinse without leaving any mark"              rating2="A_Makes the cleaned surfaces be white again"    

rating3 ="P_Allows a safely use"                                             rating4="E_Eliminates bad odours"       

rating5 ="C_Has a bottle that allows to clean under the rim"     rating6="C_Allows to keep the bowl visibly clean between use"

rating7 ="E_Leaves a fresh and clean odour"                                 rating8="E_Leaves the bowl shining for a long time"                   

rating9 ="A_Guarantees a perfect cleaning"    

rating10="A_Really makes the bowl shining"                                  rating11="P_Is made by a modern, actual brand"

rating12="C_Really makes toilet's cleaning easier"                     rating13="Is very concentrated in active agents"

rating14="E_Is globally very efficient"                                     rating15="E_Is made by a brand I trust"

rating16="C_Is easy to use"                                                       rating17="V_Is good value for money"

rating18="A_Adheres to the bowl sides"                                       rating19="A_Efficiently removes hard water deposits"

rating20="P_Has a practical bottle, very handy"                        rating21="E_Easily eliminates dirtiness even without scrubbing"

rating22="E_Is a very high quality product"                            rating23="A_Kills microbes and bacteria"

rating24="P_Has a pleasant smell"                                            rating25="P_Brings a long lasting freshness"

rating26="P_Has an attractive colour"                                       rating27="P_Is an innovative product";

 

cards ;

;

run;

* MACRO Graphique Variables sur data= out_variable *************;

%Macro graphiqueV (data= &data,  x=&X, y=&Y, XL=&XL, YL=&YL, ID=&ID, titre = &titre) ;

axis1 length= 24 cm; axis2 length= 24 cm; symbol1 V=none interpol=none;

data out_variable ; set &data; if _TYPE_='SCORE'; run ;

proc transpose data=&data out=t_variable ;run ; proc print data=t_variable ; run ;

data work; set t_variable ; keep X Y Xsys Ysys text size  color; X=&X ; Y=&Y; text=&ID ; color='black' ;

size=1; xsys='2'; ysys='2'; Label  Y=&YL X=&XL; run; proc gplot data=work; title4 &titre ;

plot Y*X=1 / haxis=axis1 vaxis=axis2 annotate=work Frame Href=0 Vref=0; run;

%Mend  graphiqueV ;

 

* Macro Graphique Individus sur data= out_individu *************;

%Macro graphiqueI (data= &data, x=&X, y=&Y, XL=&XL, YL=&YL, ID=&ID, titre = &titre,

                                  red=&red, blue=&blue, green=&green ) ;

axis1 length= 24 cm; axis2 length= 24 cm; symbol1 V=none interpol=none;

data work ; set &data ; keep X Y Xsys Ysys text size color ; X=&x ; Y=&y; text=&ID ; color='black' ;

if text=&red then color='RED' ;if text=&blue then color='BLUE';if text=&green then color='GREEN' ;

size=1; xsys='2'; ysys='2';Label  Y=&YL X=&XL; run; proc gplot data=work;

plot Y*X=1 / haxis=axis1 vaxis=axis2 annotate=work Frame Href=0 Vref=0; run;

%Mend  graphiqueI ;

 

proc format ;

value brand_fmt 1="Bref"           2="Domestos"      3="Canard WC" 4="Cillit Bang" 5="Harpic"

                        6="La Croix"      7="WC Net"        8="MDD" ;

      run ;

 

data in ; set C_7 ;

      ID = put(resp, $4.) ;

run ;

 

title4 'Tableau de synthèse des perceptions des marques';

proc tabulate data=in ;

      class brand ;

      var    rating1-rating27 ;

      table n (rating1-rating27)*mean, brand;

      format brand brand_fmt. ;

      run ;

 

ODS trace on;

proc glm data =in ;

      class brand ;

      where brand >1 ; * enlever Bref car seulement 5 réponses ;

      model rating1-rating27 = brand /ss3;

      format brand brand_fmt. ;

      run ;

oDS trace off ;

 

ODS graphics on ;

PROC FACTOR DATA= in

       Plot = (SCREE                     /* demande de l'éboulis */

       initloadings loadings)            /* graphiques des variables avant eta près rotation */

       CORR                              /* sur corrélations ou COV covariance */

       SIMPLE                            /* statistiques descriptives des variables */

       MSA                               /* test d’adéquation KMO, Bartlett*/

       METHOD=PRIN         PRIORS=smc   /* AFCS */

       ROTATE= varimax  Reorder          /* rotation oblique, tri par importance décroissante  */

       FLAG=.32                          /* identification des loadings > à cette valeur */

       NFACT= 2                          /* choix du nombre de facteurs, obligatoire si OUT = */

       OUT =        out_individu         /*on peut renommer les facteurs (rename = (factor1=F1 factor2=F2))*/     

       OUTSTAT =    out_variable ;      /* sortie d'un data avec les variables */

       VAR rating1 rating2 rating5  rating6 rating9 rating12 rating16 rating18 rating21 rating23;

RUN;

%graphiqueV(data= out_variable,   x=factor1, y=factor2, XL="Efficacité", YL="Usage",

                    ID=_name_ , titre= "premier plan factoriel Variables (colonnes)" )  ;

%graphiqueI(data= out_individu, x=factor1, y=factor2, XL="Efficacité", YL="Usage",

                    ID=ID, titre="premier plan factoriel Individus (lignes)",

                    Red=".", Blue= ".", green =".") ;

 

Title4 'Valeurs des marques sur les facteurs';

*------------------------------------------- *;

proc sort data=out_individu; by brand ; run ;

proc means data=out_individu noprint ;

      by brand ;

      var Factor1 Factor2 rating1-rating27;

      output out=out_marque mean= ;

run ;

data out_marque ; set out_marque ;

      length brand_l $12. ;

      if brand =1       then brand_l="Bref";

      else if brand=2 then brand_l="Domestos" ;

      else if brand=3 then brand_l="Canard WC" ;

      else if brand=4 then brand_l="Cillit Bang";

      else if brand=5 then brand_l="Harpic";

      else if brand=6 then brand_l="La Croix";

      else if brand=7 then brand_l="WC Net";

      else if brand=8 then brand_l="MDD" ;

run ;

proc print data=out_marque ; var brand_l factor1 factor2 ; run ;

 

%graphiqueI(data= out_marque, x=factor1, y=factor2, XL="Factor1", YL="Factor2",

                    ID=brand_l, titre="Espace perceptuel des marques",

                    Red=".", Blue= ".", green =".") ;

 

 

 

data out_radar ; set out_marque ;

array rating{27} rating1-rating27 ;

array ratingL{27} $ 25 ratingL1-ratingL27 ;

ratingL1 ="C_Easy to rinse without leaving any mark"             ;     ratingL2="A_Makes the cleaned surfaces be white again"   ;

ratingL3 ="P_Allows a safely use"                                      ;      ratingL4="E_Eliminates bad odours"       ;

ratingL5 ="C_Has a bottle that allows to clean under the rim";   ratingL6="C_Allows to keep the bowl visibly clean between use";    

ratingL7 ="E_Leaves a fresh and clean odour"                     ;     ratingL8="E_Leaves the bowl shining for a long time";                      

ratingL9 ="A_Guarantees a perfect cleaning"    ;

ratingL10="A_Really makes the bowl shining"    ;                            ratingL11="P_Is made by a modern, actual brand";

ratingL12="C_Really makes toilet's cleaning easier"  ;                 ratingL13="Is very concentrated in active agents";

ratingL14="E_Is globally very efficient"             ;                 ratingL15="E_Is made by a brand I trust";

ratingL16="C_Is easy to use"                               ;                 ratingL17="V_Is good value for money" ;

ratingL18="A_Adheres to the bowl sides"              ;                 ratingL19="A_Efficiently removes hard water deposits" ;

ratingL20="P_Has a practical bottle, very handy"     ;                 ratingL21="E_Easily eliminates dirtiness even without scrubbing" ;

ratingL22="E_Is a very high quality product"         ;                 ratingL23="A_Kills microbes and bacteria" ;

ratingL24="P_Has a pleasant smell"                         ;                 ratingL25="P_Brings a long lasting freshness" ;

ratingL26="P_Has an attractive colour"                     ;                 ratingL27="P_Is an innovative product";

      do i=1 to 27 ;

      dim= rating{i};

      dim_l=ratingL{i} ;

      output ;

      end ;

proc gradar data=out_radar;

where brand_l="Bref" or brand_l="Harpic";

   chart dim_L / overlay=brand_l

                 freq= dim

                 cstarfill=(CX7C95CA CXDE7E6F)

                 starfill=(solid solid)

                 cspokes=black

                 ctext=black ;

run ;