binary data with no correlation but with p-values equal to real data For doing parallel analysis in my real data to determine the number of its dimension, i need to simulate binary data matrix with n(number of case) by k(number of items). the p-values of these simulated data must be equal to the corresponding p-values of items in sample real data with n cases and k items. but unlike the real data that there is correlation between items, in simulated data the correlation of items must be zero.
i want to generate simulate data by the following syntax. it is just an example. let me know the correctness of my procedure:
library(MASS)
set.seed(99)
n<-100 #NUMBER OF PERSONES
K<-5 #NUMBER OF ITEMS
p1<-rep(0.2,n)# p-values of first item is 0.2
p2<-rep(0.8,n)
p3<-rep(0.1,n)
p4<-rep(0.2,n)
p5<-rep(0.3,n)
p<-cbind(p1,p2,p3,p4,p5)
X<-matrix(rbinom((n*K),1,p),n,K)#datafile
write.table(X,file="MATH.txt",row.names=FALSE,col.names=FALSE)

 A: No: you do not need to simulate binary data.
First of all, you can simply rerandomize your observed data set (i.e. shuffle/sample without replacement all $n$ observations of a variable, for each variable independently of the others). This will preserve the univariate distribution of each variable in your data set, but reduce correlation between these variables to random chance (i.e. $\mathbf{R} \to \mathbf{I}$, as $n$ increases).
Second, unless you have a very small number of observations, you can simply ignore the distribution of your data, and perform parallel analysis using normally or uniformly distributed data. See Dinno (2009). The reason for this insensitivity is that principal component analysis is based on the eigendecomposition of the correlation matrix, and linear correlations are based on means, and the distribution of means is asymptotically normally distributed: go central limit theorem! The same applies to common factor analysis which is based on the eigendecomposition of a transformation of the correlation matrix.
References
Dinno, A. (2009). Exploring the Sensitivity of Horn’s Parallel Analysis to the Distributional Form of Simulated Data. Multivariate Behavioral Research, 44(3):362–388.
