[R] testing for temperature differences between years and sites?

Jim Lemon jim at bitwrit.com.au
Wed Feb 1 09:12:24 CET 2012

On 01/31/2012 11:34 PM, swertie wrote:
> Hello!
> I have a dataset with monthly temperatures for 4 different years and I would
> like to test if they are significantly different between the years. As I
> collected the data for different sites I wondered if there were some
> possibility to perform the calculation at once or if I have to repeat it for
> each site.
> I tried like this:
> Model_Temp<- lmer(Temp ~Year + (1|Site)+(1|Month),na.action=na.omit, data=
> MeanTemp)
> But I am not sure at all if it is correct to put the sites as random factors
> or if I have to do the calculation for each site separately. I am not
> interested in correlation between sites, but only between years for each
> different site.
> Alternatively, can you indicate me some way to plot this?
Hi swertie,
Let's say you have monthly temperature readings for four sites:


Having gotten some data, you can then display a line plot of the 
temperatures for the sites:

  main="Temperature by site",xlab="Year",ylab="Temperature")

Unless you have some reason to think that the sites vary in some way 
that would affect temperature, for instance altitude, using site as a 
factor in an overall model might not get you much. Also you may want to 
test yearly averages, as there is a strong seasonal component. Thus you 
might want to think about a time series model.


More information about the R-help mailing list