[R] (auto)regression

Gavin Simpson gavin.simpson at ucl.ac.uk
Tue Dec 22 15:39:19 CET 2009


On Tue, 2009-12-22 at 15:30 +0100, Gavriel & Esti Zoladz wrote:
> 1) I want to calculate a regression, but when I enter >
> lm(formula=KS~libor+adj.close) I only get the following:
> 
> Call:
> lm(formula = KS ~ libor + adj.close)
> Coefficients:
> (Intercept)        libor    adj.close
>   -56.38666     55.39709     -0.01836
> 
> I don't get the estimated standard deviation, error, t-value etc. anymore
> which I used to get when I use an old version (2yrs ago). What command do I
> need to give in to get this information?

Assign the object returned by lm to an object in your workspace, then
use summary in that object. What you are seeing in the above is the
output from the print method for objects of class (type) "lm".

# dummay data
dat <- data.frame(x = rnorm(100), y = rnorm(100), z = rnorm(100))
mod <- lm(y ~ x + z, data = dat)
mod
summary(mod)
str(mod)

....

> 
> 2)I need to show that there is no auto regression between different
> time-series that I have, what do I give in to check this?

?acf and you might also want to consult the Time Series Task View on
CRAN:

http://cran.r-project.org/web/views/TimeSeries.html

HTH

G

-- 
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
 Dr. Gavin Simpson             [t] +44 (0)20 7679 0522
 ECRC, UCL Geography,          [f] +44 (0)20 7679 0565
 Pearson Building,             [e] gavin.simpsonATNOSPAMucl.ac.uk
 Gower Street, London          [w] http://www.ucl.ac.uk/~ucfagls/
 UK. WC1E 6BT.                 [w] http://www.freshwaters.org.uk
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%




More information about the R-help mailing list