Let's say I measured blood pressure on

In R, I can model the data this way:

But I can also reshape dat in this way:

And do:

These are the same data but the model parameters are very different. Which way of modelling the data would be more appropriate?

**day1**and**day2**three times a day (morning, afternoon and evening).
Code:

```
dat <- data.frame(ind=c(1,1,1,2,2,2,3,3,3,4,4,4), day1=c(90,113,122,86,84,95,114,126,123,115,92,103), day2=c(141,123,134,112,112,115,92,100,121,133,124,89), time=rep(c("morning","afternoon","evening"),times=4))
ind day1 day2 time
1 90 141 morning
1 113 123 afternoon
1 122 134 evening
2 86 112 morning
2 84 112 afternoon
2 95 115 evening
3 114 92 morning
3 126 100 afternoon
3 123 121 evening
4 115 133 morning
4 92 124 afternoon
4 103 89 evening
```

Code:

`mod <- lm(day1 ~ day2, data=dat)`

Code:

```
library(reshape2)
dat2 <- melt(dat, id.vars = c("ind","time"), variable.name="day)
ind time day value
1 morning day1 90
1 afternoon day1 113
1 evening day1 122
2 morning day1 86
2 afternoon day1 84
2 evening day1 95
3 morning day1 114
3 afternoon day1 126
3 evening day1 123
4 morning day1 115
4 afternoon day1 92
4 evening day1 103
1 morning day2 141
1 afternoon day2 123
1 evening day2 134
2 morning day2 112
2 afternoon day2 112
2 evening day2 115
3 morning day2 92
3 afternoon day2 100
3 evening day2 121
4 morning day2 133
4 afternoon day2 124
4 evening day2 89
```

Code:

`mod <- lm(value ~ day, data=dat2)`

Last edited: