I have this binary martix
a0=rep(1,40)
a=rep(0:1,20)
b=c(rep(1,20),rep(0,20))
c0=c(rep(0,12),rep(1,28))
c1=c(rep(1,5),rep(0,35))
c2=c(rep(1,8),rep(0,32))
c3=c(rep(1,23),rep(0,17))
da=matrix(cbind(a0,a,b,c0,c1,c2,c3),nrow=40,ncol=7)
I need to subset this matrix into two subset (matrix) having the same number of columns and different number of rows (say 85% vs 15%) but during the trim can you keep in mind that the 2 subsets don't have colinearity.
The problem I have. When I subset da using
ind <- sample(1:nrow(da), trunc(85*nrow(da)/100))
trda <- da[ind,]
teda <- da[-ind,]
i get one of these subset not full rank.
Can some one explain to me how I can subset them without getting collinearity? this is just an example. I am dealing with big matrix
Thanks