RによるBest-Worst Scaling
合崎 英男
農研機構 農村工学研究所
2013年11月30日
2013年度統計数理研究所共同研究集会
「データ解析環境
Rの整備と利用」
2
本日の構成
• BWSの概要
– BWSとは
– BWSの実施手順
– BWSの一例
• Rパッケージを利用したBWSの実施手順
– 使用するパッケージ一覧
– 例題とコード
• おわりに
• 文献
BWSとは
• Best-Worst Scaling (BWS)
– Case 1 (Object case) BWS
– Maximum Difference Scaling (MaxDiff)
– Finn, Louviere (1992)
– support.BWSパッケージ(後述)のヘルプ
• 選択データから
複数の項目の相対評価
を測定
• さまざまな分野で活用
– 食品,価値観,医療・健康,環境,交通...
• 関連文献
– 手法全般(Louviere et al. 2013)
– 理論モデル(Marley, Louviere 2005)
4
BWSの実施手順
• 大まかな手順
① 調査目的の決定
② 評価する項目リストの確定
③ 質問として提示する項目の組合せ(選択肢集合の作成)
④ 調査票の作成
⑤
Best項目とWorst項目を選択してもらう質問の実施
⑥ 回答結果の分析/各項目の評価
BWSの一例
• 澤田ら(2010)
• 国産牛の飼料自給率向上の利点に対する消費者評価
• 評価する項目リスト
① 国産牛肉の生産コストが穀物の国際価格に左右されにくくなること(国際価格)
② 国産牛肉の安定供給が図れること(安定供給)
③ 牛の食べるエサに対する安心が高まること(エサ安心)
④ 牛の排せつ物の循環利用が高まることで環境への負荷が軽減されること(環境負荷)
⑤ 海上輸送に伴う
CO
2排出量の削減により,地球温暖化の抑制に寄与すること
(
CO2削減)
⑥ 価格が安いこと(低価格)
6
BWSの一例
• 質問
国産牛肉を購入する際に「最も重視する項目」と「最も重視しない項目」を選んで下さい。
海上輸送に伴うCO2排出量の削減により,地球温暖化の抑制に寄与すること 牛の排せつ物の循環利用が高まることで環境への負荷が軽減されること 牛の食べるエサに対する安心が高まること 国産牛肉の安定供給が図れること 国産牛肉の生産コストが穀物の国際価格に左右されにくくなること 最も重視しない 項目 最も重視する• 各項目の評価結果(BW得点)
環境負荷 CO2削減 国際価格 低価格 安定供給 エサ安心 -2 -1 0 1 2 BW得点(平均)BWS向けパッケージ
• crossdesパッケージ(Sailer 2013)
– つり合い型不完備計画(Balanced Incomplete Block Design:BIBD)
の生成
• DoE.baseパッケージ(Grömping 2013)
– 2水準型直交配列表(Orthogonal Array:OA)の生成
• support.BWSパッケージ(Aizaki 2013)
– 質問の作成
– 分析用データセットの作成
– BW得点の計算
• survivalパッケージ(Therneau 2013)
– 条件付きロジットモデルの適用
8
BWSの手順と対応するR関数
データセット作成: bws.dataset()
*数え上げ法: bws.count()
*条件付きロジットモデル: clogit()
****⑥ 分析・評価
-
⑤ 調査の実施
bws.questionnaire()
*④ 調査票の作成
OA: oa.design()
**BIBD: find.BIB()
***; isGYD()
***③ 選択肢集合の作成
-
② 項目の決定
-
① 調査目的の決定
対応する
R関数
手順
*support.BWS,**DoE.base,***crossdes,****survival
BWSの手順と例題
① 調査目的の決定
野菜の評価
② 項目の決定
Tomato, Spinach, Cabbage
Lettuce, Cucumber, Carrot, Radish
③ 選択肢集合の作成
BIBD
項目数(処理数)
= 7
質問数(ブロック数)
= 7
項目数/問(ブロックの大きさ)
= 4
④ 調査票の作成
⑤ 調査の実施
回答者
10名
⑥ 分析・評価
support.BWSのbws.dataset()
に含まれている
ExamplesのCase 2を修正
(後述のコードのうち強調部分が修正箇所)
Radish Carrot Lettuce Tomato Worst Item Best10
BIBDとは
• 比較したい処理をブロックにわけるための計画
• 特徴
– 処理数(項目数)
– ブロックの大きさ(項目数/問)
– ブロック数(質問数)
– 各処理(項目)の出現回数
– 各処理(項目)ペアが同一のブロックで比較される回数
• 例(後述のfind.BIB()のコードで生成)
7 6 5 3 6 1 1 1 2 2 1 1 7 3 2 7 5 4 3 5 6 5 2 4 7 5 4 3 6 4 3 2 7 6 4 1 4 3 2選択肢集合の作成
• BIBDを利用した方法
7
6
5
3
6
1
1
1
2
2
1
1
7
3
2
7
5
4
3
5
6
5
2
4
7
5
4
3
6
4
3
2
7
6
4
1
4
3
2
Cucumber
5
Radish
7
Carrot
6
Lettuce
4
Cabbage
3
Spinach
2
Tomato
1
項目
番号
Tomato Worst Item Best12
選択肢集合の作成
> library(support.BWS)
> library(crossdes)
> library(survival)
> set.seed(123)
> des2 <- find.BIB(trt=7, # 項目数 = 7
+ k=4, # 項目数/問 = 4
+ b=7) # 質問数 = 7
> isGYD(des2)
[1] The design is a balanced incomplete block design w.r.t. rows.
> des2
[,1] [,2] [,3] [,4]
[1,] 1 4 6 7
[2,] 2 3 4 6
[3,] 2 4 5 7
[4,] 1 2 5 6
[5,] 1 3 4 5
[6,] 3 5 6 7
[7,] 1 2 3 7
質問形式への変換
> items2 <- c("tomato","spinach","cabbage","lettuce",
+
"cucumber","carrot","radish")
> bws.questionnaire(
+ choice.sets = des2, # 選択肢集合
+ design.type = 2, # 選択肢集合の作成に使用した計画の種類
+ item.names = items2) # 項目名
Q1
Best Items Worst
[ ] tomato [ ]
[ ] lettuce [ ]
[ ] carrot [ ]
[ ] radish [ ]
...
Q7
14 > res2 <- data.frame( # 行番号形式で整理した仮想10名の回答結果 + ID = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10), # 回答者ID + B1 = c(2, 1, 2, 4, 2, 2, 2, 1, 2, 1), # 問1でBestに選択した項目 + W1 = c(3 4, 3, 3, 1, 3, 3, 2, 3, 3), # 問1でWorstに選択した項目 + B2 = c(4, 3, 3, 3, 3, 1, 1, 2, 1, 1), + W2 = c(3, 2, 4, 1, 2, 3, 3, 4, 2, 4), + B3 = c(3, 1, 1, 1, 1, 1, 1, 1, 2, 1), + W3 = c(1, 4, 2, 2, 4, 4, 2, 3, 3, 3), + B4 = c(2, 2, 1, 3, 2, 2, 2, 2, 4, 1), + W4 = c(4, 4, 3, 4, 1, 3, 4, 1, 2, 4), + B5 = c(1, 3, 2, 1, 3, 2, 1, 1, 1, 1), + W5 = c(3, 1, 4, 4, 1, 4, 3, 2, 4, 3), + B6 = c(2, 1, 1, 3, 2, 4, 4, 3, 3, 3), + W6 = c(3, 2, 3, 4, 3, 2, 2, 4, 4, 2), + B7 = c(2, 1, 3, 1, 3, 2, 3, 3, 2, 2), # 問7でBestに選択した項目 + W7 = c(4, 4, 4, 4, 4, 1, 4, 1, 4, 4)) # 問7でWorstに選択した項目
回答結果データセットの準備
• 1列目=回答者を識別する変数
回答者ごとに異なる整数値
• 2列目以降=各BWS質問への回答結果(回答変数)
質問毎に,
Best
に選んだ項目の次に
Worst
に選んだ項目を配置
変数値は ①選択した項目の
行番号
か ②選択した項目の
項目番号
のどちらか
ここでは行番号形式を採用
回答者1は,問1で
Bestに
2
行目の項目(lettuce)
Worstに
3
行目の項目(carrot)
を選択(1つ前のシートのQ1を参照)
分析用データセットの作成
> dat2 <- bws.dataset(
+ respondent.dataset = res2, # 回答結果データセット
+ response.type = 1, # 回答変数のデータ形式
+ choice.sets = des2, # 選択肢集合
+ design.type = 2, # 選択肢集合の作成に使用した計画の種類
+ item.names = items2) # 項目名
選択肢集合
回答結果データセット
分析用データセット
16
BW得点の計算
• 個人
• 集計
in in inB
W
BW
=
−
r
BW
BW
std
in in=
.
B
in:質問全体を通じて個人
nが項目iをBestに選んだ回数
W
in:質問全体を通じて個人
nが項目iをWorstに選んだ回数
r :質問全体を通じた各項目の出現回数
∑
= = nN in i B B 1∑
= = nN in i W W 1 i i iB
W
BW
=
−
Nr
BW
BW
std
i i=
.
i i iW
B
BW
sqrt
.
=
i i iBW
sqrt
max
BW
sqrt
BW
sqrt
std
.
.
.
.
.
=
BW得点の計算
> bws.count(dat2) # 分析用データセット
Number of respondents = 10
Summary of disaggregated best-worst scores:
meanB meanW meanBW mean.stdBW stdev.stdBW
tomato 1.3 0.7 0.6 0.150 0.4116
spinach 2.2 0.3 1.9 0.475 0.2993
cabbage 0.9 0.4 0.5 0.125 0.2700
lettuce 1.3 1.0 0.3 0.075 0.4091
cucumber 0.4 1.3 -0.9 -0.225 0.3810
carrot 0.6 1.8 -1.2 -0.300 0.2838
radish 0.3 1.5 -1.2 -0.300 0.2297
Aggregated best-worst scores:
B W BW stdBW sqrtBW std.sqrtBW
tomato 13 7 6 0.150 1.3628 0.5032
spinach 22 3 19 0.475 2.7080 1.0000
cabbage 9 4 5 0.125 1.5000 0.5539
lettuce 13 10 3 0.075 1.1402 0.4210
18
bws.count()の出力
disaggregate(回答者毎の得点)
ID
回答者番号
B
回答者ごとに整理された項目
iがBestに選ばれた回数
W
回答者ごとに整理された項目
iがWorstに選ばれた回数
BW
回答者ごとに整理された項目
iのBとWの差(BW得点)
stdBW
標準化BW
aggregate(集計した得点)
B
項目
iがBestに選ばれた回数
W
項目
iがWorstに選ばれた回数
BW
項目
iのBとWの差(BW得点)
stdBW
標準化BW
sqrtBW
項目
iの√B/W
std.sqrtBW
標準化sqrtBW
information(BWSの基本情報)
nrespondents
回答者数
nitems
項目数
fitem
各項目の出現頻度
vnames
各項目の名前
条件付きロジットモデルによる評価
• 項目 i がbest,項目 j がworstに選択(選択確率 P
ij)
– 項目 i の効用 V
iと項目
j の効用 V
jの差が,効用差の全組合せの中で
最大であるためと考える
• 項目をダミー変数として表現
– D
i: ある質問に項目
i が提示されていれば1,そうでなければ0
– β
i:
D
iの係数
• 係数推定値が相対評価値
(
)
(
)
∑ ∑
= ≠−
−
=
m k m l k l k l j i ijV
V
V
V
P
1 ,exp
exp
i i iD
V
=
β
20
条件付きロジットモデルによる評価
> fr2 <- RES ~ tomato + spinach + cabbage + cucumber + carrot + radish + + strata(STR) # 層別変数STRの指定(bws.dataset()によって作成)> clogit(fr2, # モデル式
+ data = dat2) # 分析用データセット Call:
clogit(fr2, data = dat2)
coef exp(coef) se(coef) z p tomato 0.1438 1.155 0.310 0.464 0.640 spinach 0.7910 2.205 0.324 2.441 0.015 cabbage 0.0753 1.078 0.316 0.239 0.810 cucumber -0.5907 0.554 0.318 -1.857 0.063 carrot -0.7360 0.479 0.319 -2.306 0.021 radish -0.7334 0.480 0.322 -2.278 0.023
BW得点と条件付きロジットモデルの
係数推定値の関係
22
おわりに
• 工夫次第で応用の幅は広い
– BW得点を使った分析
– さまざま分野の適用事例を参照
• support.BWSの改良
文献
• Aizaki H (2013) support.BWS: Basic functions for supporting an implementation of best-worst scaling. • Auger P, Devinney TM, Louviere JJ (2007) Using best-worst scaling methodology to investigate
consumer ethical beliefs across countries. Journal of Business Ethics 70, 299-326.
• Chrzan K, Patterson M (2006) Testing for the optimal number of attributes in MaxDiff questions.
Sawtooth Software Research Paper Series. (Sawtooth Software社のWebサイトより入手可能)
• Chrzan K, Golovashkina N (2006) An empirical test of six stated importance measures. International
Journal of Market Research 48(6), 717-740.
• Cohen SH (2003) Maximum difference scaling: Improved measures of importance and preference for segmentation. Sawtooth Software Research Paper Series. (Sawtooth Software社のWebサイトより入 手可能)
• Finn A, Louviere JJ (1992) Determining the appropriate response to evidence of public concern: The case of food safety. Journal of Public Policy & Marketing 11(1), 12-25.
• Goodman S (2009) An international comparison of retail consumer wine choice. International Journal
of Wine Business Research 21(1), 41-49.
• Grömping U (2013) DoE.base: Full factorials, orthogonal arrays and base utilities for DoE packages. • Louviere J, Lings I, Islam T, Gudergan S, Flynn T (2013) An introduction to the application of (case
1) best-worst scaling in marketing research. Intern. J. of Research in Marketing 30, 292-303.
• Marley AAJ, Louviere JJ (2005) Some probabilistic models of best, worst, and best-worst choices.
Journal of Mathematical Psychology 49, 464-480.
• Orme B (2005) Accuracy of HB estimation in MaxDiff experiments. Sawtooth Software Research
Paper Series. (Sawtooth Software社のWebサイトより入手可能)