ttest_pair
PURPOSE
[t,p,n]=ttest_pair(indat1,indat2); %tests if indat1 > indat2 tail 1=one tailed
SYNOPSIS
function [t,p,df]=ttest_pair(indat1,indat2,tail);
DESCRIPTION
CROSS-REFERENCE INFORMATION
This function calls:
This function is called by:
- calc_tstat_scl [t_out,p_out,mn1,mn2]=calc_tstat_scl(scl1,scl2,pair_samp);
SOURCE CODE
0001 function [t,p,df]=ttest_pair(indat1,indat2,tail);
0002
0003
0004
0005
0006
0007 if nargin<3
0008 tail=0;
0009 end
0010
0011 n=length(indat1);
0012 d=indat1-indat2;
0013 md=mean(d);
0014 ssd=std(d);
0015 t=(md-0)./(ssd/sqrt(n));
0016 p=1-tcdf(abs(t),n-1);
0017
0018
0019 if tail==0
0020 p=p*2;
0021 else
0022 p=p*tail;
0023 end
0024 df=n-1;
0025
Generated on Mon 22-May-2023 06:53:56 by m2html © 2005