I have a question about how to save the output of a logistic regression model in some format (delimited, preferably) so that I can manipulate it to make nice tables in excel. I have tried print, save, write, none seem to do what I want them to. Does anyone have any ideas? Lynn D. Disney, Ph.D., J.D., M.P.H. Research Analyst SEIU 1199 1771 E. 30th Street Cleveland, Ohio 44114 Telephone: (216) 566-0117 Email: ldisney@seiu1199.org <mailto:ldisney@seiu1199.org> [[alternative HTML version deleted]]
It's not so straightforward with the manipulation, but if you're familiar with LaTeX, I'd recommend the xtable package. It makes very readable regression summaries. Kyle H. Ambert Department of Behavioral Neuroscience Oregon Health & Science University On 8/7/07, Lynn Disney <ldisney@seiu1199.org> wrote:> > I have a question about how to save the output of a logistic regression > model in some format (delimited, preferably) so that I can manipulate it > to make nice tables in excel. I have tried print, save, write, none seem > to do what I want them to. Does anyone have any ideas? > > > > Lynn D. Disney, Ph.D., J.D., M.P.H. > > Research Analyst > > SEIU 1199 > > 1771 E. 30th Street > > Cleveland, Ohio 44114 > > Telephone: (216) 566-0117 > > Email: ldisney@seiu1199.org <mailto:ldisney@seiu1199.org> > > > [[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 > and provide commented, minimal, self-contained, reproducible code. >[[alternative HTML version deleted]]
See ?sink -- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40" S 49° 16' 22" O On 07/08/07, Lynn Disney <ldisney@seiu1199.org> wrote:> > I have a question about how to save the output of a logistic regression > model in some format (delimited, preferably) so that I can manipulate it > to make nice tables in excel. I have tried print, save, write, none seem > to do what I want them to. Does anyone have any ideas? > > > > Lynn D. Disney, Ph.D., J.D., M.P.H. > > Research Analyst > > SEIU 1199 > > 1771 E. 30th Street > > Cleveland, Ohio 44114 > > Telephone: (216) 566-0117 > > Email: ldisney@seiu1199.org <mailto:ldisney@seiu1199.org> > > > [[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 > and provide commented, minimal, self-contained, reproducible code. >[[alternative HTML version deleted]]
Lynn Disney wrote:> I have a question about how to save the output of a logistic regression > model in some format (delimited, preferably) so that I can manipulate it > to make nice tables in excel. I have tried print, save, write, none seem > to do what I want them to. Does anyone have any ideas? >Hi Lynn, This is an interesting idea that might be useful in the prettyR package. You have just volunteered to be a test pilot. delim.table<-function(x,con="",delim="\t") { if(nchar(con)) { con<-file(con,"w") open.con<-TRUE } else open.con<-FALSE column.names<-names(x) if(is.null(column.names)) column.names<-colnames(x) have.col.names<-!is.null(column.names) row.names<-rownames(x) have.row.names<-!is.null(row.names) xdim<-dim(x) if(have.col.names) { cat(delim,file=con) for(col in 1:xdim[2]) cat(column.names[col],delim,sep="",file=con) cat("\n",file=con) } for(row in 1:xdim[1]) { if(have.row.names) cat(row.names[row],file=con) cat(delim,file=con) for(col in 1:xdim[2]) cat(x[row,col],delim,sep="",file=con) cat("\n",file=con) } if(open.con) close(con) } test.df<-data.frame(a=sample(0:1,100,TRUE),b=rnorm(100),c=rnorm(100)) delim.table( summary(glm(a~b*c,test.df,family="binomial"))$coefficients, con="test.csv") This output should import into Excel with no trouble (it does in OpenOffice Calc). Either use sink() or specify a filename as in the example. Jim