Post Reply 
Prime - Linear Least Squares Regression
09-01-2014, 04:07 AM
Post: #1
Prime - Linear Least Squares Regression
Ok, I am given the following data about a plant growing...
Days Height (m)
14 0.2
21 0.5
30 0.7
38 1.2
45 1.6
60 2.4

I am asked to calculate the growth rate in (m/day) based on linear least squares regression and this data.

I can do it by hand, but want to do it on the calculator.....and am confused.

The linear_regression() function says it returns 2 coefficiens for the line y=ax+b it returns a and b

So I input the following:

linear_regression( (14,.2),(21,.5),(30,.7),(38,1.2),(45,1.6),(60,2.4))

and i get a syntax error.....probably because I don't know how to enter a list....so i try entering it as:

linear_regression( {14,.2},{21,.5},{30,.7},{38,1.2},{45,1.6},{60,2.4})
and get another syntax error

the on-calculator help suggests
linear_regression( [[14,.2],[21,.5],[30,.7],[38,1.2],[45,1.6],[60,2.4]])

but i don't see how to enter this format on the calculator....totally confused, and frustrated.

Can someone please clue me in how to enter lists in a reasonably efficient manner?

Thanks in advance.

Paul
Find all posts by this user
Quote this message in a reply
09-01-2014, 04:58 AM (This post was last modified: 09-01-2014 06:12 AM by Angus.)
Post: #2
RE: Prime - Linear Least Squares Regression
Check the Statistics2Var app.
Enter your data colomn-wise like in NUM view.
switch so symbolic and choose your type of regression. You get your result in the fit window. (you have to switch to Plot to have the coefficients calculated it seems)
You can then use Statistics_2Var.S1 in different modules of the calc or copy/paste the result from Symb view in the 2Var-app.

But ifyou prefer the linear_regression command, you will propably not be able to type in the matrix as you think from the example:
Start a Matrix with Shift+5 (of course)
First entry is your first indepandant - 14 in your case. You can then hit the "," key to quickly add a colomn to the matrix. Fill in 0j;.2 there
To add a row put the cursor over +- and use "+" key.
go on...
Your are confused because you try to enter the Matrix as [[],[],.....[]] which is intuitive for computer users, but is seems to be a symbolic view for the online help..... In the calc there is the matrix entry mode. I would like to be able to use the text based entry aswell.


edit: I tried it: list works as desired. linear_regression( {{14,0.2},{21,0.5},...,{60,2.4}} )
Find all posts by this user
Quote this message in a reply
09-01-2014, 12:02 PM
Post: #3
RE: Prime - Linear Least Squares Regression
(09-01-2014 04:58 AM)Angus Wrote:  edit: I tried it: list works as desired. linear_regression( {{14,0.2},{21,0.5},...,{60,2.4}} )

Alternate method: linear_regression([X values],[Y values])

Your example: linear_regression([14,21,30,38,45,60],[0.2,0.5,0.7,1.2,1.6,2.4])
--> [4.80888676541ᴇ−2, −0.567080745342]

<0|ɸ|0>
-Joe-
Visit this user's website Find all posts by this user
Quote this message in a reply
09-01-2014, 12:51 PM
Post: #4
RE: Prime - Linear Least Squares Regression
(09-01-2014 12:02 PM)Joe Horn Wrote:  
(09-01-2014 04:58 AM)Angus Wrote:  edit: I tried it: list works as desired. linear_regression( {{14,0.2},{21,0.5},...,{60,2.4}} )

Alternate method: linear_regression([X values],[Y values])

Your example: linear_regression([14,21,30,38,45,60],[0.2,0.5,0.7,1.2,1.6,2.4])
--> [4.80888676541ᴇ−2, −0.567080745342]

Thanks Angus and Joe.....both worked.
Paul
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: