Hi All,

I am trying to run several linear regressions and print out the summay and
the anova reslts on the top of 
each other for each model. Below is a sample progarm that did not work. is
it possible to print the
anova below the summary of lm in one file?

thanks for your help



######################################################

data<-read.table("data.txt", header=T, sep='\t')

for (i in 1:100){

y<-data[,i]

lm.model<-lm(y~data$x1+data$x2+data$x3+data)

sink("results.txt", append=T)

s<-summary(lm.Model)
print(s)
sink()

an<-anova(lm.Model)
print(an)
sink()

} 
-- 
View this message in context: 
http://www.nabble.com/printing-out-the-summary-for-lm-into-a-txt-file-tp22062643p22062643.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to