[R] help on haplo.score

X. Yu xsyu at u.washington.edu
Fri Mar 7 20:26:54 CET 2003


Hi all,

Recently i am running a new package call "haplo.score" in R which compute
score statistics to evaluate the association of a trait with
haplotypes, when linkage phase is unknown.  unfortunately,
I kept getting an error message like "No variation in y values". where y
is my trait vector with 1 for disease and 0 for non-disease. if someone
happen to know why i am getting this error,  please let me know. your help
is highly appreciated.

see the following for a part of my data and code.
i have 5 loci and total 150 subjects, but here i only includes 8 of them

xuesong

## matrix for haplotype data (8x10)
geno<-matrix(c(0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0 ,1, 0, 1, 0, 1,
0, 0 ,0, 1, 0, 0, 0, 1, 0, 0,1, 1 ,0, 0, 1, 1, 0, 0, 1,
1,),byrow=TRUE,ncol=10)
geno2<-matrix(c(0, 1, 0, 1, 0, 1, 0, 1, 0, 1,0, 1, 0, 1, 0, 1, 0, 1, 0,
1,1, 1, 0, 0, 1, 1, 0, 0, 0, 1,1, 1, 0, 0, 1, 1, 0, 0, 1,
1),byrow=TRUE,ncol=10)
geno<-rbind(geno,geno2)

## trait data (binary)
y<-c(rep(0,4),rep(1,4))

## compute score statistic
library(haplo.score)
hscore<-haplo.score(y,geno,trait.type="binomial")



More information about the R-help mailing list