Skip to content
Prev 75751 / 398502 Next

do glm with two data sets

Hu, Ying (NIH/NCI) wrote:
You have several inconsistencies in your example, so it will be 
difficult to figure out what you are trying to accomplish.

 > e <- read.table("file1.txt", header=TRUE,row.names=1)
 > g <- read.table("file2.txt", header=TRUE,row.names=1)
 > e1<-exp[1,]

What's "exp"? Also it's dangerous to use an R function as a variable 
name. Most of the time R can tell the difference, but in some cases it 
cannot.

 > g1<-geno[1,]

What's "geno"?

 > d1<-data.frame(g, e)

d1 is now e and g cbind'ed together?

 > summary(glm(e1 ~ g1, data=d1))

Are "e1" and "g1" elements of "d1"? From what you've told us, I don't 
know where the error is occurring. Also, if you are having errors, you 
can more easily isolate the problem by doing:

fit <- glm(e1 ~ g1, data = d1)
summary(fit)

This will at least tell you the problem is in your call to "glm" and not 
"summary.glm".

--sundar

P.S. Please (re-)read the POSTING GUIDE. Most of the time you will 
figure out problems such as these on your own during the process of 
creating a reproducible example.