lundi 9 mai 2016

Matrix or random binomial values

I'd like to generate a N by n matrix, with colum having different p values:

N=100000
n=100
p= seq(0.005,0.995,.01)

  xsim=rbinom(N, size = n, prob = p)
  ysim=rbinom(N, size = n, prob = p)

This does not appear to have the correct dimmensions want each row to have a different p. Is there a wa y to do this with apply or otherwise. thanks




Aucun commentaire:

Enregistrer un commentaire