Dear R People: I have the output from an arima model fit in an object xxx. I want to verify that the ma1 coefficient is there, so I did the following:> xxx$coefar1 ar2 ma1 intercept 1.3841297 -0.4985667 -0.9999996 -0.1091657> str(xxx$coef)Named num [1:4] 1.384 -0.499 -1 -0.109 - attr(*, "names")= chr [1:4] "ar1" "ar2" "ma1" "intercept"> exists('xxx$coef["ma1"]')[1] FALSE>Other than using xxx$coef[3], is there another way to check this, please? Thanks in advance, Sincerely, Erin -- Erin Hodgess Associate Professor Department of Computer and Mathematical Sciences University of Houston - Downtown mailto: erinm.hodgess at gmail.com
Erin Hodgess wrote:> Dear R People: > > I have the output from an arima model fit in an object xxx. > > I want to verify that the ma1 coefficient is there, so I did the following: >> xxx$coef > ar1 ar2 ma1 intercept > 1.3841297 -0.4985667 -0.9999996 -0.1091657 >> str(xxx$coef) > Named num [1:4] 1.384 -0.499 -1 -0.109 > - attr(*, "names")= chr [1:4] "ar1" "ar2" "ma1" "intercept" >> exists('xxx$coef["ma1"]') > [1] FALSE > > Other than using xxx$coef[3], is there another way to check this, please? > > Thanks in advance, > Sincerely, > Erin > >co <- coef(xxx)["ma1"] #or co <- coef(xxx)[["ma1"]] depending on whether you want to # preserve the name exists("co") #[1] TRUE -Peter Ehlers
On 2/11/2009, at 5:27 PM, Erin Hodgess wrote:> Dear R People: > > I have the output from an arima model fit in an object xxx. > > I want to verify that the ma1 coefficient is there, so I did the > following: >> xxx$coef > ar1 ar2 ma1 intercept > 1.3841297 -0.4985667 -0.9999996 -0.1091657 >> str(xxx$coef) > Named num [1:4] 1.384 -0.499 -1 -0.109 > - attr(*, "names")= chr [1:4] "ar1" "ar2" "ma1" "intercept" >> exists('xxx$coef["ma1"]') > [1] FALSE >> > > Other than using xxx$coef[3], is there another way to check this, > please?(1) as.logical(length(grep("ma1",names(xxx$coef))) (2) length(grep("ma1",names(xxx$coef))) != 0 (3) with(as.list(xxx$coef),exists("ma1")) spring to mind. cheers, Rolf ###################################################################### Attention:\ This e-mail message is privileged and confid...{{dropped:9}}
Apparently Analagous Threads
- Different results with arima in R 2.12.2 and R 2.11.1
- How to write an estimated seasonal ARIMA model from R output?
- Using the R predict function to forecast a model fit with auto.arima function
- ARMA show different result between eview and R
- ARMAX Models in R