L'Analyse Conjointe
- Politique de produit - Analyse conjointe [4.5]
1. # Plan dexperience complet des niveaux dattributs
2. dd <- data.frame(a = gl(2,12), b = gl(4,3,24), c=gl(3,1,24)) # balanced 3-way
3. dd
4. # Modèle de préférence individuelle
5. mm<-model.matrix(~ 0+ a + b + c, dd)
6. pref<-order(runif(24))
7. df<-data.frame(cbind(pref,mm))
8. colnames(df)<-c("ordre", "a1", "a2", "b2", "b3", "b4", "c2", "c3")
9. df
10. #Utilités partielles
11. attach(df)
12. conj.lm<-lm(df$ordre~ 0 + df$a1+ df$a2 + df$b2 + df$b3 + df$b4 + df$c2 + df$c3)
13. conj.lm[[1]]
Plan d'expériences complet |
Ordre de preference en fonction des niveaux des attributs |
a b c 1 1 1 1 2 1 1 2 3 1 1 3 4 1 2 1 5 1 2 2 6 1 2 3 7 1 3 1 8 1 3 2 9 1 3 3 10 1 4 1 11 1 4 2 12 1 4 3 13 2 1 1 14 2 1 2 15 2 1 3 16 2 2 1 17 2 2 2 18 2 2 3 19 2 3 1 20 2 3 2 21 2 3 3 22 2 4 1 23 2 4 2 24 2 4 3 |
ordre a1 a2 b2 b3 b4 c2 c3 1 17 1 0 0 0 0 0 0 2 4 1 0 0 0 0 1 0 3 21 1 0 0 0 0 0 1 4 22 1 0 1 0 0 0 0 5 1 1 0 1 0 0 1 0 6 14 1 0 1 0 0 0 1 7 6 1 0 0 1 0 0 0 8 24 1 0 0 1 0 1 0 9 2 1 0 0 1 0 0 1 10 16 1 0 0 0 1 0 0 11 18 1 0 0 0 1 1 0 12 5 1 0 0 0 1 0 1 13 10 0 1 0 0 0 0 0 14 3 0 1 0 0 0 1 0 15 12 0 1 0 0 0 0 1 16 20 0 1 1 0 0 0 0 17 23 0 1 1 0 0 1 0 18 15 0 1 1 0 0 0 1 19 7 0 1 0 1 0 0 0 20 13 0 1 0 1 0 1 0 21 8 0 1 0 1 0 0 1 22 19 0 1 0 0 1 0 0 23 9 0 1 0 0 1 1 0 24 11 0 1 0 0 1 0 1 |
df$a1 df$a2 df$b2 df$b3 df$b4 df$c2 df$c3
13.291667 13.291667 4.666667 -1.166667 1.833333 -2.750000 -3.625000
- Politique de produit - Ventes espérées suivant la durée de la garantie[4.6]
1. a=35
2. b=-2
3. c=1
4. d=-4
5. x<-seq(0,5,1)
6. y<-a*(1/(1+exp(-b-c*(x))))+d
7. profit<-0.7*y-x
8. df=data.frame(PerGarantie=x, Ventes=y, Profit=profit)
9. df
10. matplot(x, df[,2:3], pch = 1:2, type = "o", col = 1:2,xlab="Valeurs de x", ylab="Ventes et/ou Profits")
11. legend(1, max(df[,2:3]),names(df)[2:3], lwd=3, col=1:2, pch=1:2)