##Multilevel data frame of tree-ring widths:
data(Prings05,envir = environment())
## Radial increments measured on 2003:
data(Pradii03,envir = environment())
## Monthly precipitation sums and average temperatures:
data(PTclim05,envir = environment())
##Modeling tree growth:
mpin <- modelFrame(Prings05, y = Pradii03,
form = NULL,# on.time = TRUE,
MoreArgs = list(only.dup = TRUE,
mp = c(1,1),un = c('mm','cm'),z = 2003))
## Detrending tree growth with a td-form model:
rlme <- ringLme(mpin,form = 'tdForm')
summary(rlme$model)
##a plot of the modeled fluctuations
d <- groupedData(lmeForm(rlme$resid,lev.rm = 1),data = rlme$resid)
plot(d,groups = ~ sample,auto.key = TRUE)
## A model of aridity:
cf <- modelFrame(PTclim05,
lv = list('year','year'),
fn = list('moveYr','wlai'),
form = NULL)
summary(cf)
## An lme model of aridity at 'plot' level:
rmod <- ringLme(cf,form = 'lmeForm')
summary(rmod$model)
rk <- groupedData(lmeForm(rmod$resid),data=rmod$resid)
plot(rk,ylab = 'detrended AI')
Run the code above in your browser using DataLab