Question: This code simulates data psi < - 0 . 6 p < - 0 . 4 z < - array ( NA , dim =

This code simulates data
psi <-0.6
p <-0.4
z <- array(NA,dim=300)
y <- array(NA,dim=c(300,5))
for(i in 1:300){
z[i]<- rbinom(n =1, size =1, prob = psi)
}
p.eff <- z * p
for (i in 1:300){
y[i,]<- rbinom(n =5, size =1, prob = p.eff[i])
}
How many sites are there in the simulated data?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!