다차원 척도법
- MultiDimensional Scaling
- 유사한 것들끼리 가깝게 공간 상에 배치하는 방법
- 시각화, 마케팅에서 많이 이용
- 비슷한 제품끼리 배치를 해 시장이 어떻게 구분되는지 알 수 있음
- 신제품을 출시할 때 소비자들이 생각하기에 신제품이 어느 위치에 있을 것인지 도출해낼 수 있음
절차
- 거리 행렬 구하기
- 다차원 척도법으로 위치 추정
- 시각화하기
거리 행렬
서울 | 인천 | 대전 | |
---|---|---|---|
서울 | 0 | 26 | 137 |
인천 | 26 | 0 | 162 |
대전 | 137 | 162 | 0 |
거리 행렬을 만드는 2가지 방법 1. 숫자를 직접 찾아 넣는 방법 2. 데이터의 변수들의 차이를 이용해 구하는 방법
다차원 척도법의 종류
- 메트릭(metric)
- 거리와 정확하게 비례하도록 위치를 찾아는 것
- 넌메트릭(non-metric)
- 거리와 정확하게 맞지 않음
- 그럼에도 불구하고 이 방식을 사용하는 이유는 거리의 숫자 자체가 중요하지 않은 경우도 있기 때문
- 소비자들이 S사 휴대폰과 A사 휴대폰의 유사성 점수를 매긴다면 2점과 4점은 메트릭의 경우에는 거리가 2배가 되지만 이 점수는 심리적 요소가 포함된 점수이기 때문에 숫자 자체가 중요하지 않음
- 정확하게 비율을 유지하는 것보다 크고 작은 관계만 유지되면 충분함
- 따라서 심리적인 요소가 포함된 거리에서는 넌메트릭이 더 결과가 잘 나오는 경우가 있음
MDS 실습
실습1
사용할 데이터: eurodist
- 유럽의 주요 도시들 간의 거리 데이터
- 목표: 거리를 이용해 유럽 지도 복원하기
cmdscale
을 통해 메트릭 MDS 시행
metric = cmdscale(eurodist)
plot(metric, type = 'n')
text(metric, rownames(metric))
isoMDS
을 통해 넌메트릭 MDS 시행
library(MASS)
nonm = isoMDS(eurodist)
plot(nonm$points, type = 'n')
text(nonm$points, rownames(nonm$points))
initial value 7.505733
final value 7.505688
converged
- 가로, 세로 축의 숫자는 크게 신경쓰지 않아도 됨
- 그래프의 방향도 중요하지 않음
실습2
사용할 데이터: USArrests
- 미국 주들 간의 범죄 비율 데이터
- 목표: 범죄 간 차이를 이용해 주들 간 범죄 특성의 유사성 계산하기
데이터 확인
head(USArrests)
Murder | Assault | UrbanPop | Rape | |
---|---|---|---|---|
Alabama | 13.2 | 236 | 58 | 21.2 |
Alaska | 10.0 | 263 | 48 | 44.5 |
Arizona | 8.1 | 294 | 80 | 31.0 |
Arkansas | 8.8 | 190 | 50 | 19.5 |
California | 9.0 | 276 | 91 | 40.6 |
Colorado | 7.9 | 204 | 78 | 38.7 |
- 주들 간의 범죄 특성의 유사성을 계산할 수 있음
거리 구하기
#max_print_lines
arrest.dist = dist(USArrests)
arrest.dist
Alabama Alaska Arizona Arkansas California
Alaska 37.177009
Arizona 63.008333 46.592489
Arkansas 46.928137 77.197409 108.851918
California 55.524769 45.102217 23.194180 97.582017
Colorado 41.932565 66.475935 90.351148 36.734861 73.197131
Connecticut 128.206942 159.406556 185.159526 85.028289 169.277110
Delaware 16.806249 45.182961 58.616380 53.010376 49.291480
Florida 102.001618 79.974496 41.654532 148.735739 60.980735
Georgia 25.841827 57.030255 86.037957 25.586129 73.997297
Hawaii 191.803050 221.193535 248.268967 147.775979 231.071093
Idaho 116.761980 146.484982 176.817674 70.587038 162.612792
Illinois 28.454877 42.911653 45.697812 67.770274 32.718802
Indiana 123.345207 152.804090 181.897801 78.478086 166.229961
Iowa 180.610105 209.983523 239.991458 134.594948 224.634659
Kansas 121.519875 151.480197 180.028914 76.753436 164.516747
Kentucky 127.284170 156.612037 187.690303 81.092848 173.207910
Louisiana 15.454449 32.348879 48.494639 61.545512 41.635562
Maine 154.145289 183.897526 214.327413 107.850730 199.931113
Maryland 64.993615 44.839492 15.015991 111.642913 36.347352
Massachusetts 91.648513 123.254209 145.875906 54.181178 129.524708
Michigan 28.485435 28.857755 39.872422 71.100281 27.746351
Minnesota 164.650964 194.253571 223.088256 119.324641 207.222537
Mississippi 27.390144 28.635118 52.708728 69.685364 55.683570
Missouri 59.788293 89.306719 116.467377 24.894377 100.988910
Montana 127.392621 156.673578 187.540849 81.163107 172.996069
Nebraska 134.436974 164.114259 193.423602 88.978930 178.100814
Nevada 37.430469 34.886817 44.797433 74.288694 26.746962
New Hampshire 179.736196 209.254415 239.255616 133.678308 224.055395
New Jersey 83.243018 114.735566 135.850396 49.844257 119.041169
New Mexico 51.643489 33.521933 13.896043 97.931200 24.495102
New York 33.710829 43.182983 40.853519 73.762118 26.900929
North Carolina 101.961022 79.376067 57.619615 147.184238 80.332123
North Dakota 192.416138 221.378590 252.808188 145.855545 238.214462
Ohio 117.387606 147.373335 174.338177 74.369752 157.998513
Oklahoma 85.848704 116.429421 143.931407 43.012673 128.779346
Oregon 78.386861 106.930117 135.672879 36.895122 120.039577
Pennsylvania 131.085087 161.600897 188.866222 86.990862 172.999364
Rhode Island 70.338112 103.903802 122.418871 42.185305 107.213106
South Carolina 44.182915 27.556487 36.890920 89.248866 47.061343
South Dakota 151.089113 179.948131 211.751576 104.455206 197.524378
Tennessee 48.347596 77.884530 108.258117 12.614278 94.727662
Texas 41.566092 72.362214 93.275988 32.744618 77.380230
Utah 118.502700 148.276094 174.257338 76.438995 157.492635
Vermont 190.370691 218.290472 251.489264 143.528569 237.435465
Virginia 80.295330 110.646690 139.424711 36.421560 124.820912
Washington 92.820472 122.147002 149.297857 51.204785 133.106574
West Virginia 156.792411 185.640863 218.006078 110.071113 204.253715
Wisconsin 183.775733 213.575397 242.312381 138.344245 226.457502
Wyoming 75.507086 106.740105 135.380390 30.987255 121.720335
Colorado Connecticut Delaware Florida Georgia
Alaska
Arizona
Arkansas
California
Colorado
Connecticut 98.081191
Delaware 41.477825 128.210179
Florida 131.405822 226.303005 99.108325
Georgia 25.093027 104.426529 33.245300 125.766490
Hawaii 159.179176 64.952367 192.366109 289.428575 167.128005
Idaho 90.886413 25.280427 119.421313 217.665179 93.116057
Illinois 47.669068 139.906469 18.151859 86.558708 45.002667
Indiana 93.615063 16.316250 125.310534 222.923866 98.772871
Iowa 152.079749 57.595573 182.709989 281.013523 156.445805
Kansas 92.179716 14.173920 123.165945 221.082722 97.174071
Kentucky 101.024749 26.343880 130.597435 228.332762 103.041448
Louisiana 49.974994 140.398077 16.976749 87.670348 38.690567
Maine 127.900156 37.647443 156.666652 255.152307 130.472564
Maryland 97.300411 191.161947 63.577984 37.783859 89.505363
Massachusetts 59.900000 40.165284 89.958324 187.043738 68.762272
Michigan 51.454835 147.266561 26.531679 80.356269 47.398101
Minnesota 134.764535 39.746698 166.141656 264.225831 140.327830
Mississippi 68.664401 153.263955 36.479172 85.390456 51.355428
Missouri 29.179788 70.695827 61.378905 157.491746 35.571337
Montana 100.751675 24.746313 130.393136 228.327856 103.302081
Nebraska 105.668349 17.865050 136.378334 234.464006 110.195735
Nevada 48.834209 146.551083 35.053245 84.255860 50.567579
New Hampshire 151.589182 57.043843 181.854695 280.247480 155.665603
New Jersey 50.420829 51.196680 80.877995 176.897174 60.778286
New Mexico 81.736222 176.580322 50.089320 51.147238 75.177723
New York 52.278102 145.268166 24.189461 81.542198 50.643657
North Carolina 138.977588 229.504009 102.861557 38.527912 127.335973
North Dakota 165.750928 73.038962 195.272271 293.622751 168.611417
Ohio 85.817539 15.036289 118.179186 215.466610 92.883637
Oklahoma 57.099737 43.036031 87.195929 184.983918 61.759858
Oregon 47.364121 53.242840 80.307223 176.810661 54.050902
Pennsylvania 101.039596 8.027453 132.003674 229.949581 106.822376
Rhode Island 43.879494 64.837104 66.208006 163.312461 50.992647
South Carolina 82.641939 172.206765 48.725148 65.187115 69.194581
South Dakota 125.302115 40.039231 154.422829 252.438844 127.294776
Tennessee 28.005892 82.192761 53.343228 148.592867 23.427548
Texas 14.501034 92.659160 39.665224 134.179917 22.851258
Utah 85.625522 15.755951 118.514556 215.533849 94.292364
Vermont 165.047690 76.617361 194.254601 292.020085 166.724923
Virginia 53.416851 49.307200 82.678716 180.286023 56.028743
Washington 60.642065 38.334058 93.604327 190.555635 68.590962
West Virginia 132.360115 47.895720 160.562418 258.460539 133.229651
Wisconsin 154.115217 58.056696 185.194195 283.423799 159.511880
Wyoming 52.036718 54.060152 77.934909 176.112606 52.119094
Hawaii Idaho Illinois Indiana Iowa
Alaska
Arizona
Arkansas
California
Colorado
Connecticut
Delaware
Florida
Georgia
Hawaii
Idaho 79.751426
Illinois 203.099606 132.811445
Indiana 69.406412 15.407790 137.256111
Iowa 29.407822 64.137119 195.329286 58.584042
Kansas 71.100844 13.964240 135.278823 3.929377 60.177487
Kentucky 70.459705 13.409698 143.599373 14.606163 53.993055
Louisiana 203.970611 130.433278 17.811232 136.255936 193.966621
Maine 50.566788 37.672404 170.033320 36.003472 27.879383
Maryland 254.687573 181.189542 53.593376 187.179192 244.930725
Massachusetts 103.097139 42.539981 100.495224 41.544314 97.277130
Michigan 209.833863 138.390968 15.591664 143.065789 201.381355
Minnesota 31.620405 49.482320 178.213636 41.706834 18.713899
Mississippi 216.832308 140.041637 41.244394 147.822258 203.972670
Missouri 132.931148 62.104428 72.315973 65.613108 124.035680
Montana 69.885120 11.764353 143.447273 13.512957 53.529898
Nebraska 59.930710 19.904271 148.806787 12.596031 46.609548
Nevada 207.733603 138.767431 22.366046 142.221658 200.738860
New Hampshire 31.220666 63.208702 194.607657 58.096988 2.291288
New Jersey 113.187323 52.822344 90.399336 51.931493 108.241813
New Mexico 239.726553 166.969608 39.135789 172.481448 230.493557
New York 208.186095 138.541907 6.236986 142.699755 200.856292
North Carolina 293.600238 217.443717 96.214188 225.019221 281.504316
North Dakota 41.335941 75.999013 208.585834 72.757474 17.548789
Ohio 74.467711 22.692069 129.311136 12.213517 67.439009
Oklahoma 106.074172 34.736724 99.294713 38.136072 96.130380
Oregon 114.490043 43.855444 91.729712 46.842075 105.072784
Pennsylvania 61.237978 23.112334 143.769329 11.662761 52.485903
Rhode Island 128.628224 63.564534 77.048621 66.187083 121.796716
South Carolina 235.800975 159.765860 46.295248 167.030207 223.795174
South Dakota 55.686713 35.219313 167.874953 34.753417 32.385336
Tennessee 144.385941 70.161599 65.675338 75.708718 133.388005
Texas 155.296008 86.410069 48.171984 89.551661 147.871194
Utah 74.139733 27.423530 129.240280 17.135052 68.996812
Vermont 51.919264 75.346931 207.925660 73.722724 26.249000
Virginia 111.850302 38.132139 95.202416 43.067157 100.816913
Washington 99.692979 33.644613 104.698615 33.545193 91.663788
West Virginia 57.271022 42.185543 174.350738 42.885196 31.068473
Wisconsin 20.824265 68.151009 197.332410 61.042608 9.508417
Wyoming 117.377212 41.672533 91.414003 48.562537 105.231412
Kansas Kentucky Louisiana Maine Maryland
Alaska
Arizona
Arkansas
California
Colorado
Connecticut
Delaware
Florida
Georgia
Hawaii
Idaho
Illinois
Indiana
Iowa
Kansas
Kentucky 15.766420
Louisiana 134.394940 140.937220
Maine 36.989863 28.407921 167.825058
Maryland 185.337881 191.939600 51.479802 218.699886
Massachusetts 39.018585 52.125713 102.551499 74.763226 152.659294
Michigan 141.398798 148.859665 16.652327 175.949680 46.129492
Minnesota 43.237715 40.199005 177.605124 19.919086 228.528707
Mississippi 146.023354 150.351588 24.708298 176.939227 48.451316
Missouri 64.015936 72.298686 71.651657 99.246007 122.059207
Montana 14.406943 3.834058 141.035457 27.733914 191.924595
Nebraska 13.789126 13.349157 147.582858 23.717715 198.508665
Nevada 140.770878 148.923940 28.472443 176.131343 53.217009
New Hampshire 59.594127 53.141321 193.137723 26.530925 244.109668
New Jersey 49.674943 62.293980 93.298231 85.843404 143.042686
New Mexico 170.716051 177.630318 37.762548 204.553123 15.890249
New York 140.757309 149.261515 21.417283 175.732439 49.798896
North Carolina 223.108964 228.131388 90.708158 254.439973 44.640565
North Dakota 74.333909 65.728304 206.240563 38.664454 257.069057
Ohio 10.920165 26.110726 129.569479 46.443514 180.335687
Oklahoma 36.115924 45.202876 98.439220 71.288779 149.281379
Oregon 45.452173 54.009629 90.893674 80.635538 141.153144
Pennsylvania 11.256109 20.555291 143.600487 32.218783 194.556958
Rhode Island 63.425941 74.523084 80.020060 97.872059 129.300657
South Carolina 165.259826 170.224939 35.001286 196.957813 28.977578
South Dakota 36.247483 25.001200 165.023998 8.537564 215.780560
Tennessee 74.222975 80.091260 61.619234 107.596561 112.305031
Texas 87.710547 96.652160 50.181471 123.250355 99.886185
Utah 15.901258 31.477135 130.331616 49.388460 180.716961
Vermont 75.535952 64.832554 204.578200 39.969613 255.122265
Virginia 41.273963 48.485049 93.315915 75.368229 144.257582
Washington 31.941196 43.214581 104.933122 68.338642 155.296008
West Virginia 44.280696 31.906112 170.919572 12.775367 221.627187
Wisconsin 62.509199 58.417977 196.748062 33.678628 247.739157
Wyoming 46.458584 52.696300 88.867992 79.043849 139.782295
Massachusetts Michigan Minnesota Mississippi Missouri
Alaska
Arizona
Arkansas
California
Colorado
Connecticut
Delaware
Florida
Georgia
Hawaii
Idaho
Illinois
Indiana
Iowa
Kansas
Kentucky
Louisiana
Maine
Maryland
Massachusetts
Michigan 108.488386
Minnesota 79.340091 184.524795
Mississippi 117.976820 35.440090 188.778706
Missouri 35.053816 77.473996 107.091456 86.084958
Montana 51.250073 148.808266 39.384515 150.610425 72.098821
Nebraska 52.326380 154.789535 30.349959 158.469555 77.453083
Nevada 107.554312 13.297368 183.527818 47.627933 76.968045
New Hampshire 96.729158 200.707150 18.828701 202.982167 123.427307
New Jersey 11.456439 98.634578 90.195898 110.016272 28.511752
New Mexico 137.911711 30.421867 213.907760 39.988623 107.097946
New York 105.673696 15.066519 183.630063 43.531598 77.722712
North Carolina 192.400624 89.032634 266.032949 78.074388 161.457146
North Dakota 112.209447 214.244090 35.698319 214.769947 137.364661
Ohio 31.231715 135.781921 49.481411 142.751287 58.635569
Oklahoma 17.650212 105.405218 79.285686 111.079521 28.390139
Oregon 24.356724 96.697880 88.216778 103.938828 19.698223
Pennsylvania 44.984108 150.488139 34.712534 155.864942 73.295157
Rhode Island 26.343880 86.740590 104.350611 96.502487 27.062335
South Carolina 135.674021 37.630440 208.249010 21.167192 103.666050
South Dakota 74.710173 173.113200 25.349951 173.492882 96.711943
Tennessee 48.854887 69.155260 117.299829 73.283354 15.502580
Texas 53.689198 55.177169 130.573198 68.863053 25.494705
Utah 30.182777 135.974446 50.638424 144.281149 59.377858
Vermont 114.196541 212.796194 41.784447 211.879730 136.672016
Virginia 23.857284 100.709086 84.452827 105.074830 24.279621
Washington 16.067669 110.660833 74.211724 118.601096 33.570821
West Virginia 82.405643 179.464760 29.160933 178.544112 103.624804
Wisconsin 98.033107 203.835080 19.437592 207.706379 126.430692
Wyoming 27.843312 97.161412 89.298936 99.743371 23.507446
Montana Nebraska Nevada New Hampshire New Jersey
Alaska
Arizona
Arkansas
California
Colorado
Connecticut
Delaware
Florida
Georgia
Hawaii
Idaho
Illinois
Indiana
Iowa
Kansas
Kentucky
Louisiana
Maine
Maryland
Massachusetts
Michigan
Minnesota
Mississippi
Missouri
Montana
Nebraska 11.528226
Nevada 148.820697 154.251937
New Hampshire 52.686051 45.987390 200.210539
New Jersey 61.674306 63.189398 97.344132 107.738480
New Mexico 177.596875 183.974917 37.467986 229.732997 128.179132
New York 149.111032 154.332109 20.645096 200.163833 95.399057
North Carolina 228.247870 235.774999 97.034272 280.505561 183.462939
North Dakota 65.474041 60.579617 214.115973 17.161876 123.275342
Ohio 25.133444 22.934908 134.495985 67.071976 41.518309
Oklahoma 44.747290 49.543314 105.249038 95.448939 22.518437
Oregon 53.512802 58.636166 95.797599 104.522151 24.505102
Pennsylvania 19.296114 11.070682 149.663021 51.998077 55.806989
Rhode Island 73.846936 76.661920 87.285337 121.050114 18.848077
South Carolina 170.390053 177.941030 48.734895 222.863837 127.057821
South Dakota 24.714368 23.641912 173.276657 31.237477 85.521693
Tennessee 80.243941 87.134207 70.326453 132.649802 42.898135
Texas 96.543772 101.373369 54.977268 147.242521 43.794749
Utah 30.001500 26.271087 134.311615 68.744236 40.453059
Vermont 64.834250 62.036280 212.903828 25.688519 125.119143
Virginia 48.308798 54.334888 100.964251 100.081966 26.264425
Washington 42.379712 45.433248 109.417914 91.189363 22.766642
West Virginia 32.101402 31.996875 179.983721 29.631065 93.151167
Wisconsin 57.861213 49.521510 202.872374 10.860018 108.867075
Wyoming 52.481235 59.093654 98.363205 104.361391 29.250641
New Mexico New York North Carolina North Dakota Ohio
Alaska
Arizona
Arkansas
California
Colorado
Connecticut
Delaware
Florida
Georgia
Hawaii
Idaho
Illinois
Indiana
Iowa
Kansas
Kentucky
Louisiana
Maine
Maryland
Massachusetts
Michigan
Minnesota
Mississippi
Missouri
Montana
Nebraska
Nevada
New Hampshire
New Jersey
New Mexico
New York 35.399011
North Carolina 59.896244 93.132218
North Dakota 242.906155 214.253425 292.388919
Ohio 165.472959 134.586515 219.202144 82.626025
Oklahoma 134.645646 104.835395 187.566442 109.576138 31.819019
Oregon 126.234266 97.132281 180.021804 118.430613 40.659193
Pennsylvania 179.907893 149.159244 232.672151 67.771749 15.755951
Rhode Island 115.067111 82.323326 168.777961 136.006470 56.980874
South Carolina 24.923082 45.747678 58.445872 234.921263 161.436117
South Dakota 201.633951 173.594873 251.190227 41.487950 46.284015
Tennessee 97.776684 71.344586 150.045593 145.643125 70.321121
Texas 84.860179 53.365907 140.746048 161.569954 81.436908
Utah 165.761515 134.404799 220.127872 84.676561 6.637771
Vermont 241.110867 213.666141 289.535231 13.044922 84.634804
Virginia 129.724207 100.841063 182.006621 113.669917 37.972753
Washington 140.351594 110.001909 194.501954 105.869967 25.747427
West Virginia 207.676022 180.137170 256.264570 36.728871 54.460720
Wisconsin 233.176178 202.749451 285.014473 23.737944 68.588993
Wyoming 125.576311 97.230345 176.747532 117.545268 44.044182
Oklahoma Oregon Pennsylvania Rhode Island South Carolina
Alaska
Arizona
Arkansas
California
Colorado
Connecticut
Delaware
Florida
Georgia
Hawaii
Idaho
Illinois
Indiana
Iowa
Kansas
Kentucky
Louisiana
Maine
Maryland
Massachusetts
Michigan
Minnesota
Mississippi
Missouri
Montana
Nebraska
Nevada
New Hampshire
New Jersey
New Mexico
New York
North Carolina
North Dakota
Ohio
Oklahoma
Oregon 12.424975
Pennsylvania 45.465371 55.166294
Rhode Island 32.204503 32.684094 70.006928
South Carolina 129.811748 122.055274 175.009628 113.440028
South Dakota 69.380689 78.015768 33.758851 97.613575 193.557356
Tennessee 39.257738 31.299361 84.170125 37.709415 91.775814
Texas 52.071681 44.813837 96.136986 34.063617 84.379441
Utah 33.540572 41.639524 18.264994 56.375527 162.574906
Vermont 109.552727 117.817231 70.671777 137.516726 232.149801
Virginia 7.355270 10.579225 51.180856 32.859854 124.064701
Washington 10.305338 15.569843 40.681445 36.847931 136.758364
West Virginia 76.526466 85.256319 41.781814 104.686628 198.833926
Wisconsin 98.532431 107.631501 53.623689 122.836843 227.323844
Wyoming 13.542526 15.630099 56.300444 31.029824 119.051963
South Dakota Tennessee Texas Utah Vermont
Alaska
Arizona
Arkansas
California
Colorado
Connecticut
Delaware
Florida
Georgia
Hawaii
Idaho
Illinois
Indiana
Iowa
Kansas
Kentucky
Louisiana
Maine
Maryland
Massachusetts
Michigan
Minnesota
Mississippi
Missouri
Montana
Nebraska
Nevada
New Hampshire
New Jersey
New Mexico
New York
North Carolina
North Dakota
Ohio
Oklahoma
Oregon
Pennsylvania
Rhode Island
South Carolina
South Dakota
Tennessee 104.341602
Texas 121.204373 24.742878
Utah 49.833423 71.979164 81.596630
Vermont 40.225862 143.862747 161.331150 87.326342
Virginia 72.859454 33.174237 48.525045 40.223501 112.937770
Washington 66.667833 46.153331 57.106742 26.182628 106.387217
West Virginia 8.766984 110.521536 128.032965 58.251266 33.968515
Wisconsin 39.184691 136.548782 149.726751 69.510934 34.370336
Wyoming 76.595300 29.977492 46.182464 46.338429 116.591252
Virginia Washington West Virginia Wisconsin
Alaska
Arizona
Arkansas
California
Colorado
Connecticut
Delaware
Florida
Georgia
Hawaii
Idaho
Illinois
Indiana
Iowa
Kansas
Kentucky
Louisiana
Maine
Maryland
Massachusetts
Michigan
Minnesota
Mississippi
Missouri
Montana
Nebraska
Nevada
New Hampshire
New Jersey
New Mexico
New York
North Carolina
North Dakota
Ohio
Oklahoma
Oregon
Pennsylvania
Rhode Island
South Carolina
South Dakota
Tennessee
Texas
Utah
Vermont
Virginia
Washington 16.477257
West Virginia 79.616581 74.434535
Wisconsin 103.686161 93.552766 39.049456
Wyoming 7.930952 23.349518 82.957218 108.354418
- 주들 간의 거리를 구해줌
- 숫자가 클수록 각 범죄간 차이가 큼
cmdscale
을 통해 메트릭 MDS 시행
arr.mds = cmdscale(arrest.dist)
plot(arr.mds, type = 'n')
text(arr.mds, rownames(arr.mds))
- 주들의 좌표가 나옴
- 범죄 수치가 비슷할수록 주들이 가까이 있음
- 우측 하단에 범죄가 많고 도시 인구가 많은 주들이 위치
MDS를 활용한 시장 세분화
- 콜라, 사이다, 물, 주스 등 음료수를 객관적인 특성으로 분류할 수 있음
- 탄산: 콜라, 사이다
- 투명: 사이다, 물
- 그러나 소비자들에게 제품들은 객관적인 특성에 의해서만 분류되지 않음
- 학교에서는 콜라, 사이다보다는 건강에 해를 끼치지 않는 물, 주스를 제공할 것 같음
- 물과 주스는 객관적인 특성만 보면 다른 제품이지만 소비자들이 비슷하다라고 느낀다면 마케팅을 할 때 물의 경쟁 상대는 주스가 될 수도 있음
- 따라서 마케팅을 할 때는 객관적인 특성도 중요하지만 심리적인 특성도 고려해야 함
실습1
음료수 간의 주관적인 거리 행렬 만들기(1~5점)
콜라 | 사이다 | 물 | 주스 | |
---|---|---|---|---|
콜라 | 0 | 2 | 5 | 3 |
사이다 | 2 | 0 | 3 | 2 |
물 | 5 | 3 | 0 | 1 |
주스 | 3 | 2 | 1 | 0 |
- 숫자가 크면 거리가 멀고 유사성이 떨어진다는 뜻 | ||||
- 숫자가 작으면 거리가 가깝고 유사성이 높다는 뜻 |
-> 엑셀로 만들어 csv 파일로 저장해 R로 불러오면 됨
cmdscale
을 통해 메트릭 MDS 시행
#hide
d = matrix(c(0,2,5,3,2,0,3,2,5,3,0,1,3,2,1,0), nrow=4, byrow=T)
cmdscale(d)
-2.5378165 | -0.33255314 |
-0.6607996 | 0.86464887 |
2.4480556 | 0.07468104 |
0.7505604 | -0.60677677 |
- d: 불러온 데이터
- 숫자들이 주관적인 거리이기 때문에 메트릭보다 넌메트릭이 더 적당함
isoMDS
을 통해 넌메트릭 MDS 시행
library(MASS)
mds = isoMDS(d)
mds$points
initial value 1.928240
final value 0.000000
converged
-2.4521328 | -0.29996730 |
-0.7948391 | 0.88577426 |
2.4822099 | 0.06673524 |
0.7647620 | -0.65254220 |
plot(mds$points, type = 'n')
text(mds$points, c('C', 'Y', 'W', 'J'))
- 가운데가 비어있으니까 중간에 위치할 만한 신제품을 새로 만드는 전략을 짤 수 있음
- 콜라는 잘 팔리는데 사이다가 잘 팔리지 않는다면 사이다의 특성을 콜라쪽으로 옮겨서 마케팅을 해볼 수도 있음
- 건강에 많은 사람들이 관심이 있다면 콜라와 사이다의 특성을 물과 주스 방향으로 옮겨 마케팅을 해볼 수도 있음
- 제품이 훨씬 많으면 더 많은 전략을 구상하기 쉬움
실습2
- 단점: 제품이 많아지면 거리를 구하기 어려워짐
- 제품 간 거리를 측정하지 말고 각 음료에 대한 선호도를 구하면 됨
A | B | C | |
---|---|---|---|
콜라 | 5 | 1 | 1 |
사이다 | 1 | 3 | 1 |
물 | 2 | 5 | 4 |
주스 | 3 | 4 | 5 |
-> 엑셀로 만들어 csv 파일로 저장해 R로 불러오면 됨
거리 구하기
#hide
pref = matrix(c(5,1,2,3,1,3,5,4,1,1,4,5), nrow=4)
d = dist(pref)
d
1 2 3
2 4.472136
3 5.830952 3.741657
4 5.385165 4.582576 1.732051
- 물과 주스의 거리가 가까움
- 물에 점수를 낮게 주는 사람은 주스에도 점수를 낮게 준다는 뜻
- 콜라와 물의 거리가 멂
- 콜라와 물은 선호가 갈리는 제품임
isoMDS
을 통해 넌메트릭 MDS 시행
mds = isoMDS(d)
plot(mds$points, type = 'n')
text(mds$points, c('C', 'Y', 'W', 'J'))
initial value 0.000000
final value 0.000000
converged
- 콜라와 사이다는 탄산 음료지만 마케팅을 다르게 해야 함