search for: fr_man

Displaying 1 result from an estimated 1 matches for "fr_man".

2009 Nov 28
1
Include manually an intercept in lm without breaking it?
...unting will be different as intercept will not be included in "automatic" case, while it will be in "manual" case. See: ###usual lm on freeny fr<-lm(freeny.y~freeny.x) ###manual lm on freeny man<-cbind(1,freeny.x) colnames(man)<-c("const",colnames(freeny.x)) fr_man<-lm(freeny.y~man-1) ###coef are the same cbind(coef(fr), coef(fr_man)) ###but summary output is different (but should be the same!). #Difference comes from fact that in the "automatic case", DF are 4 (intercept not included) summary(fr) summary(fr_man) ###Workaround: attr(fr_man$te...