The PRINCOMP function in the Statistics Toolbox returns the T^2 statistics; the PCARES function returns residuals that are used to compute the Q statistics. Hope this helps.
Thank you peter perkins,
I could see the T2 plot by using PRINCOMP function but I couldn't plot the Q statistic. I have 1024*4 matrix 4= variables,1024= samples. When I use PCARES function I have RESIDUAL=R with same dimension (1024*4). for Q statistic as I know Q=R'*R after this calculation Q matrix occurs with 4*4 dimension but I think It should be 1*1024 dimension in order to plot Q test like T2 testing. I think I miss something. Thanks for your help.
> I could see the T2 plot by using PRINCOMP function but I couldn't plot the Q statistic. I have 1024*4 matrix 4= variables,1024= samples. When I use PCARES function I have RESIDUAL=R with same dimension (1024*4). for Q statistic as I know Q=R'*R after this calculation Q matrix occurs with 4*4 dimension but I think It should be 1*1024 dimension in order to plot Q test like T2 testing. I think I miss something. Thanks for your help.
I suspect what you want is diag(R*R'), or equivalently, sum(R.^2,2).
I can calculate the confidence limit for T^2 test in matlab with
"T2Upper=p*(n-1)/(n-p)*finv(0.98,p,n-p); here p =PCs,n= sample number"
like this how can I calculate the confidence limits for Q test?