Skip to content
Back to formatted view

Raw Message

Message-ID: <4917E5BA-B15E-4EEA-9D5C-9EF8784C08E8@comcast.net>
Date: 2012-05-18T23:40:09Z
From: David Winsemius
Subject: LM with summation function
In-Reply-To: <CAJnCVAHsgi1p57ve80MbWGw-M94Hbj4WLw4Z3y2-aTHf3C-qLg@mail.gmail.com>

On May 18, 2012, at 1:44 PM, Robbie Edwards wrote:

> Hi all,
>
> I'm trying to model some data where the y is defined by
>
> y = summation[1 to 50] B1 * x + B2 * x^2 + B3 * x^3
>
> Hopefully that reads clearly for email.
>

cumsum( rowSums( cbind(B1 * x,  B2 * x^2, B3 * x^3)))


> Anyway, if it wasn't for the summation, I know I would do it like this
>
> lm(y ~ x + x2 + x3)
>
> Where x2 and x3 are x^2 and x^3.
>
> However, since each value of x is related to the previous values of  
> x, I
> don't know how to do this.  Any help is greatly appreciated.
>
>


David Winsemius, MD
West Hartford, CT