Interaction plot of medians
이전 댓글 표시
Hello,
I would like to generate an interaction plot for studying the effects of a number of categorical variables, but using sample medians as opposed to the means. I started by modifying the interactionplot.m code by replacing calls to mean or nanmean with the median equivalents, and 'mean' with @median at line 298:
[interact,num] = grpstats(y,{factor1,factor2}, {@median,'numel'});
but I get the error: ??? Error using ==> interactionplotmed>plotaninteraction at 305 Some combinations of factor levels are missing.
Error in ==> interactionplotmed at 164
plotaninteraction(ybar,group{j},group{i},varnames{j},varnames{i},...
Error in ==> intrcPlot at 144
interactionplotmed(Y,GROUP,'varnames',VARNAMES);
since my design matrix is atypical - one category (wavelet family) is only combined with certain levels of subcategories (wavelet number, wNum, and decomposition level, J). For the Db family (wType = 1) I am testing 10 sublevels (wNum = 1:10), while for the Coif family (wType = 2) there are 5 sublevels (wNum = 1:5), and for the Sym family there are 7 (wNum = 1:7). The number of levels of J is in turn dependent on wNum. For example, the design matrix for Db wavelets is: dFFdb2_6 = fullfact([2 2 4 1 3 8]);
dFFdb8_14 = fullfact([2 2 4 1 4 7]);
[dm,~] = size(dFFdb8_14);
dFFdb8_14 = dFFdb8_14 + [zeros(dm,4) 3*ones(dm,1) zeros(dm,1)];
dFFdb16_20 = fullfact([2 2 4 1 3 6]);
[dm,~] = size(dFFdb16_20);
dFFdb16_20 = dFFdb16_20 + [zeros(dm,4) 7*ones(dm,1) zeros(dm,1)];
dFFdb = [dFFdb2_6; dFFdb8_14; dFFdb16_20];
with similar ones for Coiflets and Symlets. The Db, Coif, and Sym design matrices are then stacked into one large matrix to evaluate all combinations of variables in my algorithm.
I am able to generate interaction plots in JMP easily enough, but these use the sample means and I don't believe there is a way of modifying it to use the medians.
Any help is much appreciated. Thanks!
Phil
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Continuous Wavelet Transforms에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!