Skip to content
Prev 176189 / 398503 Next

predicting values into the future

Thank you Bill and Gabor:
I do have a few years of fish sizes data (from larvae to juvenile). If I melt them together how can I create the best model to predict future weights. My weeks go up to 16 right now, but I want to predict weights for week 17 to 20. Based on both of you examples it was easy to fit a model with one year but I can't figure out how to create a model with all the years together. Perhaps my data isn't organized the correct way. See the data below:

mydf <- read.table(textConnection("first second third fourth fifth sixth seventh
0.08 0.003 0.1 0.003 0.003 0.003 0.002
0.3 0.11 0.6 0.06 0.13 0.02 0.12
1.78 0.33 2.1 0.26 0.69 0.23 0.34
2.91 0.63 4 0.76 1.51 0.87 1.08
4.4 1.51 6.2 1.63 2.57 1.27 1.91
5.5 2.34 8.17 2.49 3.2 2.65 2.8
6.69 3.3 9.64 3.6 5 3.91 4.17
7.8 5 12.1 5.5 6.2 4.9 5.2
9.1 6.2 15 7 7.7 6.3 6.7
10.6 7.7 16.5 8.5 9.2 7.8 8.2
12.1 9.2 18 10 11.6 9.4 9.7
13.6 12.2 19.5 12.9 13.3 10.9 11.2
16.8 13.7 22.2 14.4 15 12.9 13.2
18 15.7 23.7 15.9 16 13.9 14.2
20 16.7 26 16.9 16 17.2 17.9
21 18 27.2 18.1 17 18.3 19.1"),header=T)
mydf
mydf$week <- 1:16
mydf <- melt(mydf)
colnames(mydf) <- c('week','year','weights')
attach(mydf)
--- On Sun, 4/5/09, Bill.Venables at csiro.au <Bill.Venables at csiro.au> wrote: