Displaying 1 result from an estimated 1 matches for "generaterd".
Did you mean:
generated
2007 Oct 17
3
how to repeat the results of a generated probabilities
...ity (y1) and 200
times the mean of another joint distribution (y2),
that is I'm expecting to get 200 means of y1 and 200 means of y2.
y1 and y2 are probabilities that I calculate from the marginal prob. (z1 and
z2 respectively) multiple by the conditional prob. (x1 and x2 respectively),
which I generaterd from the binomial distribution.
here are the results for one mean of y1 and one mean of y2:
> y1 <- 0
> for (i in 1:200){
+ z1[i] <- rbinom(1, 1, .6)
+ x1[i] <- rbinom(1, 1, .95)
+ y1[i] <- z1[i]*x1[i]
+ }
> mean(y1)
[1] 0.605
> y2 <- 0
> for (j in 1:200){
+ z2[j] &l...