Re: [R] query

From: Greg Snow <Greg.Snow_at_intermountainmail.org>
Date: Mon 08 Jan 2007 - 18:36:05 GMT


Look at :

> myccf * c(17,18,19,18,17)/19

Do those numbers match with the result of ccf?

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow@intermountainmail.org
(801) 408-8111
 
 


> -----Original Message-----
> From: r-help-bounces@stat.math.ethz.ch
> [mailto:r-help-bounces@stat.math.ethz.ch] On Behalf Of Fluss
> Sent: Monday, January 08, 2007 6:18 AM
> To: r-help@stat.math.ethz.ch
> Subject: [R] query
>
> Hello!
> I found the ccf function gives different estimates than the
> simple lag correlations.
> Why is that?
> This is my code:
>
> set.seed(20)
> x<-rnorm(20)
> y<-x+rnorm(20,sd=0.3)
> print("R CCF:")
> print(ccf(x,y,lag.max=2,plot=F))
> myccf<- c( cor(y[-(1:2)],x[-(19:20)]) , cor(y[-1],x[-20]),
> cor(y,x),
>
> cor(x[-1],y[-20]),cor(x[-(1:2)],y[-(19:20)]) ) print("My CCF:")
> print(myccf)
>
> Thank You!
> Ron
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@stat.math.ethz.ch 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.
> ______________________________________________ R-help@stat.math.ethz.ch 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 Tue Jan 09 11:18:13 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 09 Jan 2007 - 01:30:30 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.