I figure out how to figure out the regression line using fit {I need to use FIT} for one set of number. However, I have to combine two sets and figure out the regression line.
numberset1 = {1,2,3,4,5}
numberset2 = {6,5,6,7,8}
I am doing this to figure out the regression line for the first set.
line = Fit[numberset1, {1, x}, x]
Then I graph both sets in a scatter plot with the regression line for set 1. However, I need to use both sets to figure out one regression line. I tried doing this
data = {numberset1, numberset2}
Then
line = Fit[data, {1, x}, x]
but this does not work Ive also tried
line = Fit[{numberset1,numberset2}, {1, x}, x]
did not work
Any ideas, I've already looked at the FIT line documentation in mathematica. None of the examples work.


line = Fit[Join[numberset1,numberset2], {1, x}, x]? Also, please clarify what aredata2anddata1in your code. – K.J. Nov 22 '17 at 09:15Fit[Transpose[{numberset1, numberset2}], {1, x}, x]? – K.J. Nov 22 '17 at 09:21