Thanks, Michael. Appreciate it. But suppose I go for the plot, how to extract it from R ... say, I want to save it as a .png file. Regards, Preetam On Sun, Mar 6, 2016 at 3:39 PM, Michael Dewey <lists at dewey.myzen.co.uk> wrote:> According to the documentation acf returns what you want. It also says > that it returns it invisibly if plot = TRUE which I imagine is what you are > doing. > > So try > > res <- acf(insert_parameters_here, plot = FALSE) > > and then look at res > > > > On 06/03/2016 07:40, Preetam Pal wrote: > >> Hi R-users, >> >> I have a time series of residuals and I want to get the ACF >> (autocorrelation) values till lag = 12, along with the 12 upper/lower >> confidence limits. I understand that acf(residual) would give me the plot, >> but I will also need the actual values as an array etc. Plus, I'll have to >> extract the plot from R as well. Is there a way to achieve these two? >> >> Appreciate your help. >> >> Regards, >> Preetam >> >> [[alternative HTML version deleted]] >> >> ______________________________________________ >> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >> 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. >> >> > -- > Michael > http://www.dewey.myzen.co.uk/home.html >-- Preetam Pal (+91)-9432212774 M-Stat 2nd Year, Room No. N-114 Statistics Division, C.V.Raman Hall Indian Statistical Institute, B.H.O.S. Kolkata. [[alternative HTML version deleted]]
Jean-Claude Arbaut
2016-Mar-06 19:33 UTC
[R] ACF values with confidence limits + Plot Extaction
a <- as.ts(rnorm(20)) png("acf.png") a.acf <- acf(a) dev.off() # to see what is available names(a.acf) unclass(a.acf) 2016-03-06 20:06 GMT+01:00 Preetam Pal <lordpreetam at gmail.com>:> Thanks, Michael. Appreciate it. > But suppose I go for the plot, how to extract it from R ... say, I want to > save it as a .png file. > Regards, > Preetam > > On Sun, Mar 6, 2016 at 3:39 PM, Michael Dewey <lists at dewey.myzen.co.uk> > wrote: > >> According to the documentation acf returns what you want. It also says >> that it returns it invisibly if plot = TRUE which I imagine is what you are >> doing. >> >> So try >> >> res <- acf(insert_parameters_here, plot = FALSE) >> >> and then look at res >> >> >> >> On 06/03/2016 07:40, Preetam Pal wrote: >> >>> Hi R-users, >>> >>> I have a time series of residuals and I want to get the ACF >>> (autocorrelation) values till lag = 12, along with the 12 upper/lower >>> confidence limits. I understand that acf(residual) would give me the plot, >>> but I will also need the actual values as an array etc. Plus, I'll have to >>> extract the plot from R as well. Is there a way to achieve these two? >>> >>> Appreciate your help. >>> >>> Regards, >>> Preetam >>> >>> [[alternative HTML version deleted]] >>> >>> ______________________________________________ >>> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >>> 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. >>> >>> >> -- >> Michael >> http://www.dewey.myzen.co.uk/home.html >> > > > > -- > Preetam Pal > (+91)-9432212774 > M-Stat 2nd Year, Room No. N-114 > Statistics Division, C.V.Raman > Hall > Indian Statistical Institute, B.H.O.S. > Kolkata. > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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.
Thank you very much,Jean-Claude and Michael. 1> @Michael, your suggestion "plot = FALSE" only returns the estimated ACF values, not the confidence limits at different lags. May be I am missing something here.Do you know any way around for this? 2>@Jean-Claude, got it, thanks. Regards, Preetam On Mon, Mar 7, 2016 at 1:03 AM, Jean-Claude Arbaut <arbautjc at gmail.com> wrote:> a <- as.ts(rnorm(20)) > png("acf.png") > a.acf <- acf(a) > dev.off() > > # to see what is available > names(a.acf) > unclass(a.acf) > > > 2016-03-06 20:06 GMT+01:00 Preetam Pal <lordpreetam at gmail.com>: > > Thanks, Michael. Appreciate it. > > But suppose I go for the plot, how to extract it from R ... say, I want > to > > save it as a .png file. > > Regards, > > Preetam > > > > On Sun, Mar 6, 2016 at 3:39 PM, Michael Dewey <lists at dewey.myzen.co.uk> > > wrote: > > > >> According to the documentation acf returns what you want. It also says > >> that it returns it invisibly if plot = TRUE which I imagine is what you > are > >> doing. > >> > >> So try > >> > >> res <- acf(insert_parameters_here, plot = FALSE) > >> > >> and then look at res > >> > >> > >> > >> On 06/03/2016 07:40, Preetam Pal wrote: > >> > >>> Hi R-users, > >>> > >>> I have a time series of residuals and I want to get the ACF > >>> (autocorrelation) values till lag = 12, along with the 12 upper/lower > >>> confidence limits. I understand that acf(residual) would give me the > plot, > >>> but I will also need the actual values as an array etc. Plus, I'll > have to > >>> extract the plot from R as well. Is there a way to achieve these two? > >>> > >>> Appreciate your help. > >>> > >>> Regards, > >>> Preetam > >>> > >>> [[alternative HTML version deleted]] > >>> > >>> ______________________________________________ > >>> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > >>> 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. > >>> > >>> > >> -- > >> Michael > >> http://www.dewey.myzen.co.uk/home.html > >> > > > > > > > > -- > > Preetam Pal > > (+91)-9432212774 > > M-Stat 2nd Year, Room No. > N-114 > > Statistics Division, C.V.Raman > > Hall > > Indian Statistical Institute, B.H.O.S. > > Kolkata. > > > > [[alternative HTML version deleted]] > > > > ______________________________________________ > > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > > 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. >-- Preetam Pal (+91)-9432212774 M-Stat 2nd Year, Room No. N-114 Statistics Division, C.V.Raman Hall Indian Statistical Institute, B.H.O.S. Kolkata. [[alternative HTML version deleted]]
My word! Did you try ?png ? More to the point, any good R tutorial should provide such info. Pls make some reasonable efforts on your own before posting here. Cheers, Bert On Sunday, March 6, 2016, Preetam Pal <lordpreetam at gmail.com> wrote:> Thanks, Michael. Appreciate it. > But suppose I go for the plot, how to extract it from R ... say, I want to > save it as a .png file. > Regards, > Preetam > > On Sun, Mar 6, 2016 at 3:39 PM, Michael Dewey <lists at dewey.myzen.co.uk > <javascript:;>> > wrote: > > > According to the documentation acf returns what you want. It also says > > that it returns it invisibly if plot = TRUE which I imagine is what you > are > > doing. > > > > So try > > > > res <- acf(insert_parameters_here, plot = FALSE) > > > > and then look at res > > > > > > > > On 06/03/2016 07:40, Preetam Pal wrote: > > > >> Hi R-users, > >> > >> I have a time series of residuals and I want to get the ACF > >> (autocorrelation) values till lag = 12, along with the 12 upper/lower > >> confidence limits. I understand that acf(residual) would give me the > plot, > >> but I will also need the actual values as an array etc. Plus, I'll have > to > >> extract the plot from R as well. Is there a way to achieve these two? > >> > >> Appreciate your help. > >> > >> Regards, > >> Preetam > >> > >> [[alternative HTML version deleted]] > >> > >> ______________________________________________ > >> R-help at r-project.org <javascript:;> mailing list -- To UNSUBSCRIBE and > more, see > >> 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. > >> > >> > > -- > > Michael > > http://www.dewey.myzen.co.uk/home.html > > > > > > -- > Preetam Pal > (+91)-9432212774 > M-Stat 2nd Year, Room No. N-114 > Statistics Division, C.V.Raman > Hall > Indian Statistical Institute, B.H.O.S. > Kolkata. > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org <javascript:;> mailing list -- To UNSUBSCRIBE and > more, see > 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. >-- Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) [[alternative HTML version deleted]]