[R] do glm with two data sets

From: Hu, Ying (NIH/NCI) <yhu_at_mail.nih.gov>
Date: Thu 18 Aug 2005 - 06:07:42 EST


I have two data sets:
File1.txt:

Name id1   id2   id3   ...
N1    0     1     0     ...
N2    0     1     1     ...
N3    1     1     -1    ...

...
 

File2.txt:

Group id1       id2       id3       ...
G1       1.22     1.34     2.44     ...
G2       2.33     2.56     2.56     ...
G3       1.56     1.99     1.46     ...

...

I like to do:
x1<-c(0,1,0,...)
y1<-c(1.22,1.34, 2.44, ...)
z1<-data.frame(x,y)

summary(glm(y1~x1,data=z1)  

But I do the same thing by inputting the data sets from the two files

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

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

the error message is
Error in model.frame(formula, rownames, variables, varnames, extras,
extranames, :

        invalid variable type
Execution halted  

Thanks in advance,  

Ying

        [[alternative HTML version deleted]]



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu Aug 18 06:14:01 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:39:50 EST