Re: [R] Grouped regression

2012-07-09 Thread SKrishna
Dear David, Thanks for the tip about naming the levels first with levels before assigning them. However, your answer does not solve the original question that I requested help on. I will post a simplified version as a separate query, partly because the subject line on the present one seems to

Re: [R] Grouped regression

2012-07-08 Thread David Winsemius
On Jul 8, 2012, at 7:55 AM, SKrishna wrote: Hi, Thanks for the reply. Sex[120:144]<-factor(TG) #Renaming some males to transgender, to create 3 groups, male, female and transgender Sorry, that should have been Sex[120:144]<-factor('TG') The original line did not have the quotes. I show

Re: [R] Grouped regression

2012-07-08 Thread SKrishna
Hi, Thanks for the reply. > Sex[120:144]<-factor(TG) #Renaming some males to transgender, to > create 3 groups, male, female and transgender Sorry, that should have been Sex[120:144]<-factor('TG') The original line did not have the quotes. >I'm getting the sense that this is homework. You

Re: [R] Grouped regression

2012-07-08 Thread David Winsemius
On Jul 8, 2012, at 4:11 AM, Suresh Krishna wrote: Hi, I am a very occasional user of R, and will be grateful for some help in constructing a regression across groups. Here is an example: library(MASS) attach(cats) Sex[120:144]<-factor(TG) #Renaming some males to transgender, to create

[R] Grouped regression

2012-07-08 Thread Suresh Krishna
Hi, I am a very occasional user of R, and will be grateful for some help in constructing a regression across groups. Here is an example: library(MASS) attach(cats) Sex[120:144]<-factor(TG) #Renaming some males to transgender, to create 3 groups, male, female and transgender out<-lm(Bwt