Code covered by the BSD License
-
KendallTau(x,y)
-
MakeCorr(V)
-
[data,data2,k,k2]=npar_wilcox...
npar_wilcoxrsum called by npar_main performs nonparametric wilcoxon rank-sum test
-
[data,k]=npar_vdwaerden(data,...
npar_vdwaerden called by npar_main performs nonparametric Van Der Waerden normal scores test
-
[data,k]=npar_wilcoxsr(data,k)
npar_wilcoxsr called by npar_main performs nonparametric wilcoxon signed-rank test
-
[datasign,signs,signpval,sign...
npar_sign called by npar_main performs nonparametric sign test
-
[datasign,signs,signpval,sign...
npar_sign called by npar_main performs nonparametric sign test
-
[mcpval,mcsplus]=npar_pitmanm...
npar_pitmanmc called by npar_main performs nonparametric pitman Monte Carlo test
-
[p, r, t, R, T ] =SpearmanRan...
-
[pitind,meansmall,datasmallsu...
npar_pitmanind called by npar_main performs nonparametric pitman test for independent samples
-
[runsrandompval,runsrandompva...
npar_runsrandom called by npar_main performs nonparametric runs test for randomness
-
[spit,statm,sminus,pval1,stat...
npar_pitman called by npar_main performs nonparametric pitman test
-
[tkstat,pval1,pval2,tknormalp...
npar_kendallrank called by npar_main performs nonparametric kendall rank correlation coefficient test
-
[unstat,umstat,u1,pval1,u2,pv...
npar_wilcoxmwrsum called by npar_main performs nonparametric wilcoxon-mann-whitney rank-sum test
-
[unstat,umstat,u1,pval1,u2,pv...
npar_wmwrsum called by npar_main performs nonparametric wilcoxon-mann-whitney rank-sum test
-
gammax(z)
-
npar_main(method,data,data2,t...
npar_main is the main program for Erik's Matlab nonparametric statistical toolbox
-
npar_wilcoxsr_ci(dataorg,k,n,...
npar_wilcoxsr_ci called by npar_main performs nonparametric wilcox signed-rank confidence intervals
-
pitman_mc(data,testmedian,n)
Pitman_MC finds Monte Carlo test for right-tail Pitman test
-
npar_data.m
-
View all files
from
NonParametric Statistical Toolbox
by Erik Erhardt
These are MatLab functions for performing Exact and approximate NonParametric statistics on small da
|
| [mcpval,mcsplus]=npar_pitmanmc(data,k) |
function [mcpval,mcsplus]=npar_pitmanmc(data,k)
% npar_pitmanmc called by npar_main performs nonparametric pitman Monte Carlo test
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Nonparametric Statistical Tests in Matlab
%
% Author:
% Carlos Morales cmorales@wpi.edu
% Statistics
% Dept. of Mathematical Sciences
% Worcester Polytechnic Institute
% 100 Institute Rd.
% Worcester, MA 01609-2280
%
% Date: 2/6/2003 1:30PM
%
% Program: npar_pitmanmc.m
% Includes:
% Pitman Monte Carlo
% Called by:
% npar_main.m
%
% Pitman_MC finds Monte Carlo test for right-tail Pitman test
% [mcpval,mcsplus]=npar_pitmanmc(data,testmedian,n)
%
% inputs
% data vector of data
% testmedian median value of null hypothesis
% n number of simulations
%
% outputs
% mcpval MC p-value
% mcsplus montecarlo simulated S_pluses
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
fprintf('\nPitman MC using n=10000\n');
n = 10000;
plus = find(data>0);
S_plus = sum(data(plus));
% For exact value we need to compute all possible combinations of plus and
% minuses, and add all the probabilities of values for S_plus that fall in
% the rejection region.
% Monte Carlo: we generate n vectors of 0-1 rv's and asign signs to items
% in the vector data, compute S_plus for each, and compute the
% (1-alpha)% percentile of this distribution.
datamc=data';
for i=1:n
rand = binornd(1,0.5,1,k);
mcsplus(i) = sum(abs(datamc.*rand));
end
tail = find(or(mcsplus>S_plus,mcsplus==S_plus));
mcpval = length(tail)/n; % MC p-value
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
Contact us at files@mathworks.com