経時観測データの縦長形式と横長形式
* 経時 (longitudial) 観測データ
時間に依存する (time-varing) データを含む観測データのこと.
* 形式
下記の3種類のデータを含む経時 (longitudial) 観測データの表示形式には, 横長形式 (wide style) と縦長形式 (long style) がある.
- 時間に依存する (time-varing) データ
- 時間に無関係な (time-constant) データ.
- 時刻 (timestamp) データ
* 縦長形式 (long style)
縦長形式 (long style) の例は下記の通り.
subject time conc 1 0.25 1 1 0.50 2 1 0.75 3 2 0.25 4 2 0.50 5 2 0.75 6 3 0.25 7 3 0.50 8 3 0.75 9 4 0.25 10 4 0.50 11 4 0.75 12

* 横長形式 (wide direction)
横長形式 (wide direction) の例は下記の通り.
subject\time 0.25 0.50 0.75 1 1 2 3 2 4 5 6 3 7 8 9 4 10 11 12
* rep(1:4, rep(2,4))
* 縦長形式 (long style) から横長形式 (wide direction) への変換
wx <- reshape(lx, v.name="conc", idvar = "subject", timevar = "time", direction = "wide" )

* 縦長形式 (long style) から横長形式 (wide direction) への変換
lx <- reshape(wx, direction = "long");
