[R] Hardy Weinberg Simulation

David Duffy davidD at qimr.edu.au
Thu Jun 30 00:00:20 CEST 2011


> 
> I have the code below but the p-values are not what I am expecting. I want
> to use the Cochran Armitage trend test to get the p-values.

What do you expect? Depending on the genetic model, you may not see HWE in the
"cases".

> datamat[h,] <- t(rmultinom(1, size=c(10, 40, 50), prob=c(0.33, 0.33, 0.34)))

"size" should be the total size ie 100.

-- 
| David Duffy (MBBS PhD)                                         ,-_|\
| email: davidD at qimr.edu.au  ph: INT+61+7+3362-0217 fax: -0101  /     *
| Epidemiology Unit, Queensland Institute of Medical Research   \_,-._/
| 300 Herston Rd, Brisbane, Queensland 4029, Australia  GPG 4D0B994A v



More information about the R-help mailing list