Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ABC
- PPL
- DDC
- ZEC
- ABC
- CCD
- RL3
- list1 <- 1:30
- list2 <- 1:40
- list3 <- 1:50
- n <- 1000
- runs <- data.frame(run=1:n,threes=NA,twos=NA)
- for(i in 1:n) {
- sample_list1 <-(sample(list1,5, replace=FALSE))
- sample_list2 <-(sample(list2,10, replace=FALSE))
- sample_list3 <-(sample(list3,20, replace=FALSE))
- combined_lists <- c(sample_list1, sample_list2, sample_list3)
- combined_counts <- as.data.frame(table(combined_lists))
- runs$three[i] <- sum(combined_counts$Freq==3)
- }
- runs
- #calculate p value when 994 overlaps observed in real data
- pval3 = sum(runs$threee >= 994)/1000
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement