[R] linear regression with replication

Christof Kluß ckluss at email.uni-kiel.de
Mon May 23 16:31:54 CEST 2011


Hi,

we want to calculate a linear regression that results from three test
series. (The "Average linear regression" over 3 replication.)
Each test serie consists of the values ​​for 3 times (0min, 25min,
50min) and is repeated three times.

We need such a regression for each combination of subject and day for a
file like this:

   subject time       date replication value
1        A    0 2011-01-01           1   0.2
2        A   25 2011-01-01           1   0.3
3        A   50 2011-01-01           1   0.4
4        A    0 2011-01-01           2   0.2
5        A   25 2011-01-01           2   0.2
6        A   50 2011-01-01           2   0.3
7        A    0 2011-01-01           3   0.3
8        A   25 2011-01-01           3   0.4
9        A   50 2011-01-01           3   0.5
...             2011-01-02  ...
...             2011-01-02  ...
                2011-01-02
[...]
         B

Can you give us a hint how the R-file could look for this example? We
think that we should choose the library "nlme" and the command "lme". We
are interested in the slope and intercept for each combination of
subject and date.

Greetings
Christof



More information about the R-help mailing list