[R] nested time series data with measurement error

Toby Gass tobygass at warnercnr.colostate.edu
Wed Apr 23 18:09:15 CEST 2008


Dear R helpers,

I am trying to fit a model with the main objective of
assessing differences, rather than predicting.
The treatment was applied to half of the subjects after 9
months of measurement.
Then 9 more months of data were collected. The variable
"month" has measurement error
due to the complexities of data collection.
The dependent variable is numeric and continuous.
This would be a simple difference between means were it not
for the repeated
measurements and measurement error.

I am wondering what the R gurus suggest as to which R
function might best model
these data.  I have been looking at tsls (two-stage least
squares) in the sem package
and pls (partial least squares).  I am not sure about their
compatibility with repeated
measurements and time series.  The response curve is also
likely to be non-linear.

The following script approximates the data, including sample
size.  In the real data, there are 18 months spread out over 
a
36 month period.

#generate data

tree<- gl(6,18,label = paste("tree",1:6))
month <- gl(18,1,length = 108,label = paste("month",1:18),
ordered = TRUE)
trtmt <- gl(2, 54, length = 108, label = paste("trt",1:2))
pre.post <- gl(2,9,length = 108,  label = c("pre","post"))
response <- runif(108, min = -28, max = -25)
help <- data.frame(tree,month,trtmt,pre.post, response)


Thank you in advance for your assistance.

Toby Gass

Graduate Degree Program in Ecology
Department of Forest, Rangeland, and Watershed Stewardship
Warner College of Natural Resources
Colorado State University
Fort Collins, CO  80523
email: tobygass at cnr.colostate.edu



More information about the R-help mailing list