* options nocenter formdlim="-" ; title1 'Expérimentation'; 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 '2008 (c) Pierre Desmet'; * *******lecture des données sur l'expérimentation prix **********************; * exemple de JJ Lambin, La recherche marketing; * 3 niveaux de prix (p), 4 tailles de magasins (m) et 30 mesures par magasin; ******************************************************************************; Data in ; input Q Prix Magasin; cell =(prix-1)*4+magasin ; Label prix="Variation de prix" Q="ventes vol." Magasin="Type de magasin"; cards ; 1.25 1 1 1 1 1 1.75 1 1 1.5 1 1 1.75 1 1 1.25 1 1 1.5 1 1 0 1 1 0.5 1 1 1.5 1 1 0.75 1 1 0.25 1 1 0.25 1 1 1 1 1 1.75 1 1 0 1 1 0.75 1 1 0.25 1 1 1.5 1 1 1 1 1 0 1 1 0.25 1 1 1.25 1 1 0.75 1 1 0.25 1 1 1 1 1 1 1 1 2 1 1 1 1 1 0.25 1 1 1.75 1 2 0 1 2 1.25 1 2 1.25 1 2 1 1 2 1.25 1 2 0.5 1 2 1.25 1 2 2.5 1 2 2 1 2 3.25 1 2 1.5 1 2 2.25 1 2 0.75 1 2 0.5 1 2 1.5 1 2 1.25 1 2 3.5 1 2 2.25 1 2 0 1 2 0 1 2 2.75 1 2 0.5 1 2 2 1 2 1.5 1 2 2 1 2 2 1 2 2.25 1 2 1.25 1 2 0 1 2 7 1 3 2 1 3 1.75 1 3 5 1 3 2.75 1 3 2 1 3 2.75 1 3 2.5 1 3 0.75 1 3 3.5 1 3 2.75 1 3 5 1 3 1.25 1 3 2.75 1 3 1.25 1 3 4.75 1 3 0.5 1 3 1.25 1 3 4 1 3 4 1 3 0 1 3 4.75 1 3 4.75 1 3 0 1 3 3.5 1 3 1 1 3 2.25 1 3 3.75 1 3 3 1 3 4.25 1 3 2.75 1 4 3.25 1 4 5 1 4 11 1 4 4.25 1 4 4.75 1 4 5.25 1 4 3.25 1 4 2.75 1 4 5.25 1 4 1 1 4 2.25 1 4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 4 0.75 3 1 0.75 3 1 0.25 3 1 0.5 3 1 1 3 1 0 3 1 0.5 3 1 0.5 3 1 1 3 1 0.5 3 1 0 3 1 1.25 3 1 0.25 3 1 0 3 1 0.5 3 1 0.5 3 1 0.25 3 1 0 3 1 1 3 1 0.5 3 1 1 3 1 0.5 3 1 1 3 1 0.75 3 1 1 3 1 0 3 1 0.5 3 1 0.5 3 1 1 3 1 0.5 3 1 0.5 3 2 1.75 3 2 0 3 2 1.25 3 2 1.25 3 2 1.75 3 2 0.75 3 2 1 3 2 1 3 2 1.5 3 2 1.25 3 2 0.75 3 2 0.5 3 2 1.75 3 2 1.5 3 2 1.75 3 2 0 3 2 3 3 2 1.25 3 2 2 3 2 0.5 3 2 1.75 3 2 3.5 3 2 1.25 3 2 1 3 2 0.75 3 2 0.5 3 2 0.25 3 2 2.25 3 2 0.5 3 2 0.5 3 3 4 3 3 3 3 3 3.25 3 3 2.5 3 3 0.5 3 3 1.5 3 3 2.5 3 3 4.25 3 3 4 3 3 3.25 3 3 1 3 3 1.25 3 3 2.25 3 3 5.75 3 3 1.75 3 3 3.75 3 3 3.75 3 3 2.5 3 3 2.75 3 3 1.75 3 3 1.75 3 3 4.75 3 3 1.25 3 3 3 3 3 0.25 3 3 2.75 3 3 3.5 3 3 0.5 3 3 2 3 3 2.5 3 4 2.5 3 4 4 3 4 2.5 3 4 3.25 3 4 3.5 3 4 5.25 3 4 3.25 3 4 2.5 3 4 4.25 3 4 2.25 3 4 3.5 3 4 1.25 3 4 3 3 4 2.25 3 4 2.5 3 4 3.25 3 4 1.75 3 4 1 3 4 2.25 3 4 4.25 3 4 2.75 3 4 5.75 3 4 2.5 3 4 0 3 4 1.25 3 4 2.75 3 4 2 3 4 0.75 3 4 4 3 4 ; run; Title3 'impression'; proc print data=in (obs=10); run ; proc format ; value prixfmt 1="-15%" 2="Normal" 3="+15%"; value magasin 1="Super petit" 2="Super grand" 3="Hyper petit" 4="Hyper grand" ; ods graphics on; proc gchart data=in ; vbar prix /discrete group=magasin sumvar= Q type=mean ; format prix prixfmt. magasin magasinfmt. ; run; ods graphics off; PROC TABULATE data=in ; CLASS Prix Magasin ; VAR Q ; TABLE (Magasin all)*(Prix all), Q*(N*F=3.0 (MEAN STD)*F=8.3); Title3 'Tableau de synthèse'; run; PROC UNIVARIATE data=in normal ; VAR Q ; histogram / cfill=red normal midpoints= 0 to 10 by .25; qqplot / normal(mu=est sigma=est color=red); Title3 'étude univariée total échantillon'; run; proc sort data=in; by cell; run; PROC UNIVARIATE data=in normal ; by cell ; VAR Q ; histogram / cfill=red normal midpoints= 0 to 10 by .25; qqplot / normal(mu=est sigma=est color=red); Title3 'étude univariée'; run; proc sort data=in; by prix ; proc boxplot data=in; plot q*prix; format prix prixfmt.; run; proc ttest data=in ; where prix=1 or prix =2; class prix ; var q; Title3 'test en t -15% / normal'; proc ttest data=in ; where prix=3 or prix =2; class prix ; var q; Title3 'test en t +15% / normal'; Title3 'Anova simple'; * ANOVA simple ; ********************; Proc GLM DATA=in; CLASS Prix; model Q = Prix / ss3 solution; MEANS prix /HOVTEST=LEVENE ; format prix prixfmt.; title3 'anova prix' ; run; Title3 'Anova deux variables'; * ANOVA multiple ; ********************; Proc GLM DATA=in; CLASS Prix Magasin; model Q = Prix Magasin / ss3 solution; format prix prixfmt. magasin magasinfmt. ; means prix / dunnett ("Normal") bon scheffe; title3 'anova prix et magasin' ; run; proc sort data=in; by magasin prix ; proc boxplot data=in; by magasin; plot q*prix; run; * ANOVA avec interaction et contraste; *************************; Proc GLM DATA=in; CLASS Prix Magasin; model Q = Prix Magasin Prix*Magasin / ss3 solution; contrast '-15% / contrôle' prix 1 -1 0; contrast '+15%/ contrôle' prix 0 -1 +1 ; contrast 'effet du test ' prix -0.5 1 -0.5 ; format prix prixfmt. magasin magasinfmt. ; title3 'anova prix, magasin et interaction avec contraste' ; RUN ; proc sort data=in; by magasin; run; proc standard data=in mean=0 std=1 out=tab1; by magasin ; var q ; proc print ; run; Proc GLM DATA=tab1; CLASS Prix; model Q = Prix / ss3 solution; MEANS prix /HOVTEST=LEVENE ; format prix prixfmt.; title3 'anova prix' ; run; *****************************************************; * régression sur variables binaires pour comparaison ; *****************************************************; * creation de variables binaires ; *********************************; DATA TAB1 ; set in; n=_N_ ; P1=0 ; P2=0; P3=0; if prix=1 then P1=1 ; else if prix=2 then P2=1 ; else P3=1; M1=0 ; M2=0; M3=0; M4=0; if magasin=1 then M1=1 ; else if magasin=2 then M2=1 ; else if magasin=3 then M3=1; else M4=1; Proc REG data=tab1; modele1 : model Q = P1 P3 M1-M3 ;* enlever une modalité à chaque variable; output out=regprev pred=qest; title3 'régression' ; run ; * sortie d'un graphique pour comparaison; ****************************************; Proc plot data=regprev; plot n*q='+' n*qest='0' / overlay haxis=0 to 11 by 1 vaxis=1 to 360 by 1; Run ;