What do you mean by "in c"? There are additional programs that can be used to calculate HWE - hwsnp for instance. You need to install them into the main program.
Thank you for the answer. At the same time I would like to request you if you could provide me the e-copy of this book (if possible) as it is not available with me.
Hi! Just came across this question here. It has been a few years since this was posted but it might help new visitors!
STATA has 2 commands for hardy weinberg equilibrium calculations: hwsnp and genhw. Both are user written commands and have to be installed. You can do that using the help command.
hwsnp is a quick command that can be used on SNPs that are in the genotype format (AA, GG, AG etc) and gives pearson's chi p-value, LR test p-value and an exact test p-value. For those SNPs where all 3 variants of the genotype are not present in the population (eg: out of AA, GG and AG, only 2 are present out of 3), the hwsnp command breaks, i.e. it doesnt give a p-value for those SNPs. In that case, you need to break the genotype into single alleles (AG broken into A and G in two separate variables) and run the genhw command on the two allele variables for that SNP.