Re: [R] Help - linear regression

2008-01-25 Thread Mark Difford
Hi All, Thanjuvar wrote: >> model2<-lm(lavi~age+sex+age*race+diabetes+hypertension, data=tb1) David wrote: >> in the second equation you are only including the interaction of >> age*race, >> the main effect of age, but not the main effect of race which is what >> came out significant >> in y

Re: [R] Help - linear regression

2008-01-25 Thread S Ellison
a*b is not an interaction term. An interaction term looks like a:b. y~age*race means y~age+race+age:race. For TB> model1<-lm(lavi~age+sex+race+diabetes+hypertension, data=tb1) TB> model2<-lm(lavi~age+sex+age*race+diabetes+hypertension, data=tb1) both main effects are present in model 2 (below) a

Re: [R] Help - linear regression

2008-01-25 Thread David Young
Thanjavur, I'm new to R, so it is possible I'm interpreting you syntax incorrectly, but it looks like in the second equation you are only including the interaction of age*race, the main effect of age, but not the main effect of race which is what came out significant in your first model. In effec