I have some data that i ran a regression on and got the usual r output, with the a intercept and b coefficient for my independent variable. i want to forecast the number of future events using these parameters. What function / packages in R would you recommend to be used in good effect for these purposes?? -- View this message in context: http://n4.nabble.com/forecasting-tp974326p974326.html Sent from the R help mailing list archive at Nabble.com.
?predict HTH Stephan DispersionMap schrieb:> > I have some data that i ran a regression on and got the usual r output, with > the a intercept and b coefficient for my independent variable. > > i want to forecast the number of future events using these parameters. > > > What function / packages in R would you recommend to be used in good effect > for these purposes??
Hi thanks. Another question... When R prints the regression output onto the screen after i perform my regression: output_dat <- lm(.... results <- summary(output_dat) results How do i print the regression output to a file for inclusion into a document. I tried: cat(summary(output_dat), file="results.txt")) but this doesnt work and it tells me type list (in the first argument) cannot be handled by cat. So how do i get the output of lm to the desktop....as i need to put this in a document (in atble would be even better). Stephan Kolassa wrote:> > ?predict > > HTH > Stephan > > DispersionMap schrieb: >> >> I have some data that i ran a regression on and got the usual r output, >> with >> the a intercept and b coefficient for my independent variable. >> >> i want to forecast the number of future events using these parameters. >> >> >> What function / packages in R would you recommend to be used in good >> effect >> for these purposes?? > > ______________________________________________ > R-help at 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. > >-- View this message in context: http://n4.nabble.com/forecasting-tp974326p974704.html Sent from the R help mailing list archive at Nabble.com.
On Dec 18, 2009, at 6:34 AM, DispersionMap wrote:> > > Hi thanks. > > Another question... > > When R prints the regression output onto the screen after i perform my > regression: > > output_dat <- lm(.... > results <- summary(output_dat) > results > > How do i print the regression output to a file for inclusion into a > document. >?capture.output> I tried: cat(summary(output_dat), file="results.txt")) > > but this doesnt work and it tells me type list (in the first argument) > cannot be handled by cat. > > > So how do i get the output of lm to the desktop....as i need to put > this in > a document (in atble would be even better). > > > > Stephan Kolassa wrote: >> >> ?predict >> >> HTH >> Stephan >> >> DispersionMap schrieb: >>> >>> I have some data that i ran a regression on and got the usual r >>> output, >>> with >>> the a intercept and b coefficient for my independent variable. >>> >>> i want to forecast the number of future events using these >>> parameters. >>> >>> >>> What function / packages in R would you recommend to be used in good >>> effect >>> for these purposes?? >> >> ______________________________________________ >> R-help at 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. >> >> > > -- > View this message in context: http://n4.nabble.com/forecasting-tp974326p974704.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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.David Winsemius, MD Heritage Laboratories West Hartford, CT
Hi, To save the output to a text file you can use sink(file="results.txt") summary(output_dat) sink() See ?sink for details. To output to a table, you can use xtable or Hmisc::latex. -Ista On Fri, Dec 18, 2009 at 6:34 AM, DispersionMap <frenchcr at btinternet.com> wrote:> > > Hi thanks. > > Another question... > > When R prints the regression output onto the screen after i perform my > regression: > > output_dat <- lm(.... > results <- summary(output_dat) > results > > How do i print the regression output to a file for inclusion into a > document. > > I tried: ?cat(summary(output_dat), file="results.txt")) > > but this doesnt work and it tells me type list (in the first argument) > cannot be handled by cat. > > > So how do i get the output of lm to the desktop....as i need to put this in > a document (in atble would be even better). > > > > Stephan Kolassa wrote: >> >> ?predict >> >> HTH >> Stephan >> >> DispersionMap schrieb: >>> >>> I have some data that i ran a regression on and got the usual r output, >>> with >>> the a intercept and b coefficient for my independent variable. >>> >>> i want to forecast the number of future events using these parameters. >>> >>> >>> What function / packages in R would you recommend to be used in good >>> effect >>> for these purposes?? >> >> ______________________________________________ >> R-help at 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. >> >> > > -- > View this message in context: http://n4.nabble.com/forecasting-tp974326p974704.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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. >-- Ista Zahn Graduate student University of Rochester Department of Clinical and Social Psychology http://yourpsyche.org
What about validating forecasting results. I have 5 years of data and have been forecasting the following three years i.e. 2010 to 2012. How can i check my forecast. Why types of tests are out there that can be implemented in R?? -- View this message in context: http://n4.nabble.com/forecasting-tp974326p975010.html Sent from the R help mailing list archive at Nabble.com.