Dear R-list, I have a statistical problem with the comparison of short time-series, representing densities of fish in different streams. For each stream (6 in total, here below showed only part of the dataset) I have 8 years of density data, as follows: year density stream 1 2000 0.51 stream1 2 2001 0.87 stream1 3 2002 0.68 stream1 4 2003 0.56 stream1 5 2004 0.50 stream1 6 2005 0.51 stream1 7 2006 1.07 stream1 8 2007 1.02 stream1 9 2000 0.23 stream2 10 2001 0.43 stream2 11 2002 0.56 stream2 12 2003 0.59 stream2 13 2004 0.52 stream2 14 2005 0.36 stream2 15 2006 0.28 stream2 16 2007 0.38 stream2 17 2000 0.07 stream3 18 2001 0.06 stream3 . . There is a clear problem of non-indipendence of data, so this seem to preclude a classical ANOVA and subsequent pairwise comparisons. What I would like to test is: are mean densities different among streams from 2000 to 2007? Is it sufficient and appropriate a test of correlation (using rcorr of the library Design, for example) to test if density trends in time are similar among streams? Any help would be greatly appreciated. Simone Simone Vincenzi, PhD Department of Environmental Sciences University of Parma [[alternative HTML version deleted]]
Simone Vincenzi-2 wrote:> > I have a statistical problem with the comparison of short time-series, > representing densities of fish in different streams. For each stream (6 in > total, here below showed only part of the dataset) I have 8 years of > density > data, as follows: > > > year density stream > > 1 2000 0.51 stream1 > > 2 2001 0.87 stream1 > Are mean densities different among streams from 2000 to > 2007? Is it sufficient and appropriate a test of correlation (using rcorr > of > the library Design, for example) to test if density trends in time are > similar among streams? > >Have a look at function gls in in package nlme. gls(density~year*stream,....) There are some similar examples in the book coming with nlme (chapter 5.4) Dieter -- View this message in context: http://n4.nabble.com/Comparing-means-and-trends-in-short-time-series-tp1474688p1474750.html Sent from the R help mailing list archive at Nabble.com.
I received also this message that did not show up here: This sounds like a problem in (linear) mixed effects models. Look into packages nlme (with the lme() function) and lme4 (function lmer()) for starters. What you have falls under the heading of longitudinal or repeated measures data. Both packages allow flexibility in the choice of within-unit covariance structure. It seem that it is trickier than it seems. I cannot test the gls(density~year*stream,..) as I do not have replicates within stream, but only one measurement for each stream. I tried to compare via anova the two models: Mixed1 <- lme(density~year, data=mydata, random=~1|sector) Mixed2 <- lme(density~year, data=mydata, random=~1|year/sector) But I'm not sure I can fit the Mixed2 model. Many thanks for the answers so far. Any ideas? Simone Vincenzi, PhD Department of Environmental Sciences University of Parma Viale G. P. Usberti, 33/A, 43100 Parma, Italy Phone: +39 0521 905696 Fax: +39 0521 906611 e.mail: <mailto:svincenz@nemo.unipr.it> svincenz@nemo.unipr.it [[alternative HTML version deleted]]