On Tuesday, Mar 30, 2004, at 21:56 US/Pacific, John Pearson wrote: > I am not very good at math. Please assume I am younger than 9 or older > than 40. > > I want my mpu to be able to create values for a linear regression > equation from 4 values that are entered, example: > > When A = 6, B = 2.1 > When A = 30, B = 0 > Do you mean "linear regression" (which, being over 40, I don't remember what that means), or are you just looking for a 'curve fit' so that you can derive an algorithm or equation so that you can find B if you know A is 15? (for example.) In the latter case, you have a nice straight line equation (since you have only two points.) these have the form B = m*A + I where "m" is the slope of the line ((B1-B2)/(A1-A2)) and I is the "intercept" value when A is 0. You can get that pretty easily once you have m and a known point. (hmm. For a computer, re-arrange:) A1 = m * B1 + I I = A1 - (m*B1) so in your case, you have m = (30-6)/(0-2.1) = -11.43 (more or less) and then 30 = -11.43*0 + I, or I = 30 - (-11.43 * 0), so I = 30. So you have: A = -11.43*B + 30 Checking your other point, 6 = -11.43*2.1 + 30? Yep! See also: http://www.mcgrawhill.ca/school/booksites/ calculus+and+advanced+functions/student+resources/toc/ review+of+prerequisite+skills/equation+of+a+line+given+two+points/ worked+example.php There are more complicated mechanisms for fitting a more complicated curve to more than two data points, given only the numeric values of the points, but at that point you should probably seek out a book on "Numeric analysis." BillW -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu