[R] an issue about missing data

karena dr.jzhou at gmail.com
Thu Aug 5 21:59:36 CEST 2010


library(GenABEL)
gs.b <- gs
ok <- complete.cases(gs.b at phdata[,c('sex','age','b.dbp','b.bmi')])
gs.b <- gs.b[ok]
gs.b at phdata <- gs.b at phdata[,c('id','sex','age','b.dbp','b.bmi')]
index=1:gs.b at gtdata@nsnps
ran.snp=sample(index,261,replace=F)
gs.b.gkin=ibs(gs.b[,ran.snp], weight="freq")

attach(gs.b at phdata)
age2 <- age^2
age3 <- age^3
##lm.bmi <- lm(bmi~age+age2+age3+sex)
##step.bmi <- step(lm.bmi)
##bmi.adj <- residuals(step.bmi)

h2.gs.b <- polygenic(b.dbp~age+age2+age3+sex+b.bmi, kin=gs.b.gkin,
data=gs.b)


######
Hi, david, above is my code. So I first removed the 3 individuals who have
some missing data, then I performed the polygenic function with the complete
data.

thanks,

karena
-- 
View this message in context: http://r.789695.n4.nabble.com/an-issue-about-missing-data-tp2315094p2315536.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list