우발상황표와 모자이크 플롯의 방향에 대해 걱정하는 사람이 있습니까? 나는 그것을 사용하지 않지만 JMP 사용자 중 한 명이 모자이크 플롯과 일치하도록 테이블의 방향을 바꾸고 싶어했습니다. X와 Y를 바꾸면 테이블과 모자이크 플롯이 모두 업데이트된다는 것을 알았습니다. 예제를 실행하고 나란히 비교하려면 아래 스크립트를 참조하세요. 쉽게 보고 참조할 수 있도록 표의 숫자가 모자이크 플롯의 셀과 정렬되기를 원하는 것 같습니다. 이전 토론을 찾을 수 없습니다. 분할표는 변경할 수 없는 것으로 보이며 아무것도 변경할 수 없는 CrossTabBox입니다. 아래 스크립트의 상단 부분에는 x와 y를 전환할 때 만들어진 테이블의 복제본을 만든 다음 이를 모자이크 플롯에 추가하는 해결 방법이 있습니다. 또한 정렬을 위해 Value Ordering을 약간 수행해야 했습니다. JMP 위시리스트에 추가됩니다. JMP Discovery Summit 2018에서 EA 연구소 및 개발자들과 논의한 적이 있습니다.
R 언어에서 dir() 인수를 사용하고 가로 및 세로를 지정할 수 있는 몇 가지 게시물을 찾았지만 RStudio의 "count" 출력은 방향에 대해 동일하게 유지됩니다.
# R 모자이크 플롯 예 - 방향 변경
getwd()
직원 <- read.csv("Products.csv", TRUE, sep = ",",
na.strings = TRUE)
개수 <- 테이블(직원$EnglishCountryRegionName,
직원$색상)
세다
mosaicplot(count, main = "국가 모자이크 플롯",
sub = "국가별 제품 색상",
xlab = "색상",
ylab = "국가",
라스 = 1,
dir = c("h", "v"),
색상 = "하늘색2",
테두리 = "초콜릿")
// For a contingency table report, swap the x and y
// currently can swap the mosaic plot only
Names Default to Here(1);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
myr = Contingency( Y( :Age ), X( :sex ) );
// Have to have a Contingency Analysis report open
// Can add test to make sure it is open in the future
myr = Current Report();
// taking apart CrossTabBox was easier using XML than JSL
mys = myr["Contingency Table"][CrossTabBox(1)] << Get XML;
// get current X role or rows of contingency table
start = Contains(mys,"<CROSSTABBOXROWSLABEL>")+22;
end = Contains(mys,"</CROSSTABBOXROWSLABEL>");
newY = Substr(mys,start,end-start);
// get current Y role or cols of contingency table
start = Contains(mys,"<CROSSTABBOXCOLSLABEL>")+22;
end = Contains(mys,"</CROSSTABBOXCOLSLABEL>");
newX = Substr(mys,start,end-start);
// Recreate same contingency table but with X and Y flipped
// also temporarily use Value Order to match the Mosaic Plot
myValueLabels = Reverse(Associative Array(Column(dt,newX)) << Get Keys);
Column(dt,newX) << Set Property("Value Ordering",myValueLabels);
tempCont = Contingency( Y(Column(dt,newY) ), X(Column(dt,newX) ), Contingency Table );
tempContr = tempCont << Report;
mycopy = tempContr["Contingency Table"][CrossTabBox(1)] << Clone Box;
tempCont << Close Window;
Column(dt,newX) << Delete Property("Value Ordering");
// remove the original contingency table and replace with transpose
myr["Contingency Table"][CrossTabBox(1)] << Delete;
myr["Contingency Table"] << Append(mycopy);
// show original side by side
obj = Contingency( Y( :Age ), X( :sex ) );
Report(obj)["Contingency Table"] << Set Title("Contingency Table - Current output");
myr["Contingency Table"] << Set Title("Contingency Table - Wish List for JMP16");
안녕 @Vball247 , 당신의 제안에 감사드립니다! 귀하의 요청을 접수했으며 검토하겠습니다.
안녕 헤게두스1. 훌륭한 제안입니다! 하지만 한 걸음 더 나아가야 했다. 모자이크 플롯을 수행할 때 Y축은 0에서 1 또는 백분율이지만 Y축을 클릭하면 최소값, 최대값 및 역순이 회색으로 표시되어 선택할 수 있는 옵션이 없습니다. "가로 모자이크"를 선택한 다음 누적 축을 그대로 두고 하나의 범주 순서를 변경할 수 있는 제안을 수행해야 합니다. 그것은 마침내 그 아래의 표와 일치합니다.
Contingency(
Y( :age ),
X( :sex ),
Contingency Table,
Horizontal Mosaic( 1 ), // swap the axes
SendToReport( Dispatch( {"Mosaic Plot"}, "1", ScaleBox, {Reversed Scale} ) ) // reverse the categories to match table
);
더 간단한 해결책이 있습니다.
모자이크 플롯의 Y축에서 역방향 축을 선택합니다.
내 요청/소원: 비상 플랫폼 기본 설정에서 이 방향을 옵션으로 만드십시오.