[R] Help with short time series

Spencer Graves spencer.graves at pdf.com
Thu Aug 10 10:50:37 CEST 2006


	  Please see the examples in "?corCAR1".  If you are fitting models 
like this, I highly recommend you spend some quality time with Pinheiro 
and Bates (2000) Mixed-Effects Models in S and S-Plus (Springer).  As 
part of this, I suggest you work through the script files "ch01.R", 
"ch02.R", ..., "ch06.R", "ch08.R" in the "~\library\nlme\scripts" 
subdirectory of the R installation on your hard drive.  This will alert 
you to subtle differences between the R syntax and that of the book and 
help you avoid silly typographical errors that can ruin your whole day.

	  Enjoy,
	  Spencer Graves

Simone Vincenzi wrote:
> Thanks for the help. 
> I provide below the dataset I'm using, it's a little bit different from what 
> I was describing (sorry for that). The streams are 3 and I have an unequal 
> number of years for each stream.
> 
> Stream Density Year 
> 1     Zak    0.20 2000 
> 2     Zak    0.36 2001 
> 3     Zak    0.41 2002 
> 4     Zak    0.34 2003 
> 5     Zak    0.28 2004 
> 6     Gor    0.08 1999 
> 7     Gor    0.05 2000 
> 8     Gor    0.14 2001 
> 9     Gor    0.16 2002 
> 10    Gor    0.13 2003 
> 11    Gat    0.18 2004 
> 12    Gat    0.10 2001 
> 13    Gat    0.37 2002 
> 14    Gat    0.57 2003 
> 15    Gat    0.47 2004
> 
> I tried to follow the suggestions of Dieter, but the model does not fit. 
> Any suggestion will be appreciated
> 
> 
> 
> Dear R-list, 
>> I have a statistical problem with the comparison of two short time-series 
> of 
>> density data in an ecological framework. I have to compare two short time 
>> series (5 years, one value for each year) of species density data (it is 
> the 
>> density of fish in two different streams) to test if the two means of the 
>> five densities are significantly different, so basically if the two mean 
>> stream-specific fish densities are significantly different. 
>> I don't think I can use a straight t-test due to the problem of 
>> autocorrelation and I don't think I can use a repeated measure ANOVA as I 
>> don't have any replicates. 
>> Any help would be greatly appreciated.
> 
> try something like
> 
> library(nlme) 
> summary(lme(dens~stream+year,data=mystreamdata,random=~year|stream))
> 
> This should also give you an estimate if the slopes are different if you 
> test 
> against the simplified model
> 
> summary(lme(dens~stream+year,data=mystreamdata,random=~1|stream))
> 
> Since you did not provide a short example data set, this is only 
> approximatively 
> right.
> 
> Dieter
>



More information about the R-help mailing list