[R] How to extract vectors from an arima() object and into a data frame?

From: zerfetzen <zerfetzen_at_yahoo.com>
Date: Thu, 17 Apr 2008 15:40:14 -0700 (PDT)

This should be very easy, but alas, I'm very new to R. My end goal is to calculate p-values from arima().

Let's say I just ran this:

> MyModel <- arima(y[1:58], order=c(1,0,0), xreg=MyData[1:58,7:14],
> method="ML")
> MyModel

And I see:

arima(x = y[1:58], order = c(1, 0, 0), xreg = MyData[1:58, 7:14], method = "ML")

Coefficients:

         ar1  intercept       x1       x2      x3      x4        x5      x6
      0.5812   -52.7725  -0.0270  -6.3467  2.8435  4.3727  -14.9045  -3e-04
s.e.  0.1328    16.6182   0.0212   3.6454  1.5571  0.5641    2.4294   2e-04
          x7      x8
      2.4094  1.0823

s.e. 0.5134 0.3093

sigma^2 estimated as 1.223: log likelihood = -88.35, aic = 198.71

To calculate a p-value, all I have to do is:

  1. Let z = parameter / s.e.
  2. Let abs_z = abs(z)
  3. Let p = 1 minus the integral of a normal distribution from -z to z

How do I extract the coefficients and standard errors out of the MyModel object, place them in their own data frame? From there, I'm sure I could calculate the p-value.

I have found that:

> coef(MyModel)

...shows the coefficients, but I'm unable to get them into a data frame. I tried:

> parameters$coef <- coef(MyModel)

But when I try...

> parameters <- edit(parameters)

...I don't see what I would expect, a column of coefficients. And I don't know how to refer to the standard errors. Help? Thanks.

-- 
View this message in context: http://www.nabble.com/How-to-extract-vectors-from-an-arima%28%29-object-and-into-a-data-frame--tp16757321p16757321.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.
Received on Thu 17 Apr 2008 - 23:19:46 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 18 Apr 2008 - 04:30:29 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive