# [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)

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:

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)

> parameters\$coef <- coef(MyModel)

> parameters <- edit(parameters)

```--
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