test of independence
if i have categoriacl data 15 col and 5000 rows,
the values are 0 or 1
0 means no missing
1 means missing
how can i test the indpendency, Is the missing independent across the all data?
• 2,204 views
•
link
1 answer
See fisher's exact test: ?fisher.test.
zero.one = matrix(rbinom(15*5000,1,0.5), ncol=15)
ccounts = apply(zero.one, 2, function(x) c(sum(x), 5000-sum(x)))
fisher.test(ccounts, simulate.p.value=TRUE)
Fisher's Exact Test for Count Data with simulated p-value (based on 2000 replicates)
data: ccounts
p-value = 0.3318
alternative hypothesis: two.sided
• 0 views
•
link
Log in to answer this question.
Do you want to test for independence among adjacent rows? Or do you want to know if missing values tend to occur within the same rows?
I think op want's to find independence of columns, but it is impossible to be sure after repeated questions, most likely he doesn't understand or describe the problem well. op repeatedly said "all the data" which not neccessarily makes sense. So I gave an answer according to how the question makes most sense: Alternative hypotheses: "The number of missing genotypes dependends on the sample" If the question is "Does the number of missing genotypes depend on the marker?", then the zero/one matrix can just be transposed, I assume.
I change the values in the matrix from missing values ike this ./. to 1 other 0.
now is the missing which is one's independent , or there is a pattern also i need to test the correlation, it is 0 and 1 so i do not think so the cor command works here.
Dear Michael, mybe you are write, every row in my data is position.
thanks thanks
In fact, I am interested to test both