[R] forecasting

Ista Zahn istazahn at gmail.com
Fri Dec 18 16:35:06 CET 2009


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




More information about the R-help mailing list