Displaying 2 results from an estimated 2 matches for "genocase".
Did you mean:
encase
2020 Oct 29
1
R: sim1000G
....bar = as.matrix(x.bar)
beta.val = t(as.matrix(beta.val))
#disease prvalance = 1%
#beta0 = -log(99)-beta.val %*% x.bar
#disease prvalance = 1.5%
beta0 = 0-beta.val %*% x.bar
eta = beta.val %*% t(gt[,causal])
eta = as.vector(eta) + rep(beta0,nrow(gt))
prob = exp(eta)/(1+exp(eta))
genocase = rep(NA, sample.size)
set.seed(seed.num)
for(i in 1:sample.size){
genocase[i] = rbinom(1, 1, prob[i])
}
case.idx = sample(which(genocase==1),1000)
control.idx = sample(which(genocase==0),1000)
return(rbind(gt[case.idx,],gt[control.idx,]))
}
How I can modify code in a way that it...
2020 Nov 01
0
R: sim1000G
...(beta.val))
> #disease prvalance = 1%
> #beta0 = -log(99)-beta.val %*% x.bar
> #disease prvalance = 1.5%
> beta0 = 0-beta.val %*% x.bar
>
> eta = beta.val %*% t(gt[,causal])
> eta = as.vector(eta) + rep(beta0,nrow(gt))
> prob = exp(eta)/(1+exp(eta))
>
> genocase = rep(NA, sample.size)
>
> set.seed(seed.num)
> for(i in 1:sample.size){
> genocase[i] = rbinom(1, 1, prob[i])
> }
> case.idx = sample(which(genocase==1),1000)
> control.idx = sample(which(genocase==0),1000)
>
> return(rbind(gt[case.idx,],gt[control.idx,])...