[R] save p-value in mshapiro.test(mvnormtest)

2007-11-16 Thread Jiao Yang
Dear all, I want to save the p-value from mshapiro.test(mvnormtest). But mshapiro.test(mvnormtest) gives a list with class "htest" containing statistic, p.value, method and data.name as a whole. How do I save only p-value from the result? Thanks a lot! __

[R] generate multivariate F with specified correlation matrix

2007-11-16 Thread Jiao Yang
Dear all, In MATLAB, to generate multivariate F with specified correlation matrix Pn I can use the code such as Z = mvnrnd([0 0 0 0 0], Pn, N); U = normcdf(Z,0,1); X = [finv(U(:,1),5,15) finv(U(:,2),5,15) finv(U(:,3),5,15) finv(U(:,4),5,15) finv(U(:,5),5,15)]; Is there something similar in R?

[R] generate multivariate F with specified correlation matrix

2007-11-16 Thread Jiao Yang
Dear all, In MATLAB, to generate multivariate F with specified correlation matrix Pn I can use the code such as Z = mvnrnd([0 0 0 0 0], Pn, N); U = normcdf(Z,0,1); X = [finv(U(:,1),5,15) finv(U(:,2),5,15) finv(U(:,3),5,15) finv(U(:,4),5,15) finv(U(:,5),5,15)]; Is there something similar in R?