(71B) Linear Regression with a User Keyboard
|
01-28-2019, 12:32 AM
Post: #1
|
|||
|
|||
(71B) Linear Regression with a User Keyboard
Linear Regression with a User Keyboard
This program creates a user keyboard with the following keys defined: [ I ] Clears the statistics array and variables [ A ] Add a data point X,Y: the sample size is shown [ D ] Delete a data point X,Y: the sample size is shown [ M ] Sample Mean for X and Y data. Press CONT for mean of Y values. [ S ] Sums for X and Y data. Press CONT for sum of Y values. [ E ] Standard Deviation for X and Y data. Press CONT for standard dev. of Y values. [ R ] Execute Linear Regression. A = intercept, B = slope, correlation is calculated, fit to the line Y = A + B*X [ H ] Help: cycles what all the keys do [ X ] Clears all the user keys, prepares you to go to the next program PROGRAM STATLIN 689 bytes, 1/26/2019 Code:
Example to try: Data: X,Y -5.56, 0.79 -4.30, 0.84 1.86, 1.93 2.24, 2.01 3.95, 2.26 To add data: (in USER mode) [ A ] -5.56, 0.79 [END LINE] (repeat for all data points) Results: n = 5 Mean: [ M ] "X-BAR=" -0.362 [ f ] [ + ] (CONT) "Y-BAR=" 1.566 Sums: [ S ] "∑X=" -1.81 [ f ] [ + ] (CONT) "∑Y=" 7.83 Standard Deviations: [ E ] "sX=" 4.26696847891 [ f ] [ + ] (CONT) "sY=" 0.696512742166 Linear Regression: [ R ] "INT=" 1.62489805306 [ f ] [ + ] (CONT) "SLP=" 0.162701804029 [ f ] [ + ] (CONT) "r=" 0.996741950615 [ f ] [ + ] (CONT) "Y=1.6248905306 + 0.162701804029 X" |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)