[R] glmnet for Binary trait analysis

Noah noah.hu at hotmail.com
Wed Sep 21 02:25:12 CEST 2011


Hello, 

I got an error message saying 

Error in lognet(x, is.sparse, ix, jx, y, weights, offset, alpha, nobs,  : 
  NA/NaN/Inf in foreign function call (arg 5)

when I try to analysis a binary trait using glmnet(R) by running the
following code

library(glmnet)
Xori <- read.table("c:\\SNP.txt", sep='\t');
Yori <- read.table("c:\\Trait.txt", sep=',');
Y=as.matrix(Yori);
X=t(as.matrix(Xori));
fit1=glmnet(X, Y, family="binomial");

in the above, X is a matrix with values 1, 0, and -1; Y is a one column
matrix with values 1 and 0.

I know how to analysis continuous traits using glmnet, but I have no idea
about how to do it for binary dependent variables. I will appreciate it if
you would give me any suggestion about this error or provide an example code
for handling binary trait using glmnet. 

Looking forward for your kindly help.

Thanks!

Noah

--
View this message in context: http://r.789695.n4.nabble.com/glmnet-for-Binary-trait-analysis-tp3828547p3828547.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list