[R] Odp: : Question about correlation between data.

David Scott d.scott at auckland.ac.nz
Sat Oct 17 03:01:35 CEST 2009


Petr PIKAL wrote:
> Hi
> 
> r-help-bounces at r-project.org napsal dne 16.10.2009 15:24:05:
> 
>> hi everybody, I'm a student, and I'm new using R! 
>> I'm looking for statistical 
>> help hoping somebody can answer me! 
>>
>> This is my problem: 
>> I have 2 temporal 
>> series. The firstone is a series of mesured data (height of monitorated 
>> points), the second is a series of temperature (in Celsius degree). 
>>
>> Using 
>> Matlab I have built  the two graphs (Measured Data - Time & Temperature 
> - 
>> Time). 
>>
>> Looking those graphs I can surely say that there is a clear 
>> correlation beetween theme, and also that the measured data are surely 
>> influenced by the variations of temperature. 
>>
>> Unfortunately my statistical 
>> knowledges are not that large so using R seems quite difficult to me. 
>>
>> My 
>> question is: is there a code already written the can compare the 2 
> temporal 
>> series and can find the correlation between the data??? 
> 
> If the relationship is linear than
> 
> lm(values~temperature, ...)
> 
> shall suffice
> 
> if it is nonlinear than you can look e.g. to
> 
> ?nls
> 
>> And also: is there a 
>> code that can correct the Measured Data from the influence of 
> temperature and 
>> return a clean data??? 
> 
> maybe ?predict.
> 
> Regards
> Petr
> 
> 

This sounds a little dangerous to me. Antonio is wanting to determine 
correlations between *time series* if I understand correctly.

The time series need to be prewhitened or the correlations between 
successive observations modeled in some way. Just using lm can be very 
misleading because of the violation of the independence assumption.

If Antonio does not understand these comments he needs to consult a 
local statistician.

David Scott



-- 
_________________________________________________________________
David Scott	Department of Statistics
		The University of Auckland, PB 92019
		Auckland 1142,    NEW ZEALAND
Phone: +64 9 923 5055, or +64 9 373 7599 ext 85055
Email:	d.scott at auckland.ac.nz,  Fax: +64 9 373 7018

Director of Consulting, Department of Statistics




More information about the R-help mailing list