Could any kind of person tell me the formula to calculate Linkage disequilibrium in the plink. The results calculated by plink is different from that calculated by the script I wrote which uses the R2 = (ad - bc)^2/((a + b)(a+c)(c+d)(b+d)). Thank you.
See the "correlation coefficient" definition under http://en.wikipedia.org/wiki/Linkage_disequilibrium#Definition , and the discussion at http://pngu.mgh.harvard.edu/~purcell/plink/ld.shtml#ld2 . The basic r^2 computation involves correlation between the 0/1/2 allele counts instead of haplotype frequencies, but you can also tell plink to estimate haplotype frequencies and use the standard formula on them (results will rarely differ by much).