在以下示例中,我發現Col Quantile函數(在JMP15中)返回錯誤的數據。附表test.jmp包含3列。對於它們中的每一個,使用Col Quantile和Quantile計算75和25個分位數。結果不同(JMP13正常工作)
dt=current data table();
cols={"A","B","C"};
quant = function({dt2, c},{xx,p75,p25},
xx=column(dt2,c) << get values;
show(quantile(0.75,xx));
show(quantile(0.25,xx));
p75= col quantile(column(dt2,c),0.75); show(p75);
p25 =col quantile(column(dt2,c),0.25); show(p25);
);
sub_set = function({dt,c},{dt2},
dt << select columns(c) << select all rows;
dt2=dt << subset(invisible, selected columns, selected rows, linked to original data table(0));
return(dt2);
);
for(i=1, i<=nitems(cols), i++,
c=cols[i];
dt2= sub_set(dt, c);
quant(dt2,c);
);