hohenTp<- read.table("C:/CLIM/HohenT.txt",header=T) ###
attach(hohenTp)
n<- length(Year); options(digits=3)
Wi<- dcly+jan+feb; Sp<- mar+apr+may
Su<- jun+jul+aug; Au<- sep+oct+nov #no averaging necessary
Quar<- cbind(Wi,Sp,Su,Au) #binding Wi,Sp,Su,Au together
#Quar is a n x 4 matrix
"----Residuals from polynomials(4)-trend----"
Ja<- Year-1800; Ja2<- Ja*Ja; Ja3<- Ja2*Ja; Ja4<- Ja2*Ja2
Quares<- Quar-predict(lm(Quar~Ja+Ja2+Ja3+Ja4)) #residuals
"1 | 2 refers to preceding | succeeding year"
Quares1<- cbind(Quares[(1:(n-1)),(1:4)])
Quares2<- cbind(Quares[(2:n),(1:4)])
Quares<- cbind(Quares1,Quares2) #Quares is a (n-1) x 8 matrix
colnames(Quares)<- c("Wires1","Spres1","Sures1","Aures1",
"Wires2","Spres2","Sures2","Aures2")
cor(Quares) #cross tabulation of pairwise correlations
detach(hohenTp) ###
rm(list=objects()) ###