Skip to content
Prev 294984 / 398506 Next

LM with summation function

On 19/05/12 05:44, Robbie Edwards wrote:
If your mail says what it seems to say, then your question makes
no sense.  You are in effect trying to fit a linear model to a single
point:

     y = B1*s1 + B2*s2 + B3*3

where s1 = sum(x), s2 = sum(x^2) and s3=sum(x^3)

and you have only a single value of each of s1, s2, s3.

If you have replicate values of s1, s2, and s3 (i.e. replicate
vectors (x1, ... x50)) --- and of course a corresponding y value
for each replicate --- then just form s1, s2, and s3 as vectors
whose entries correspond to the replicates and then fit

     lm(y ~ s1 + s2 + s3)

If I have misunderstood what you are asking then please provide
a self-contained reproducible example as the posting guide requests.

     cheers,

         Rolf Turner