I dont know if I am confused or if I am doing this incorrectly.
I have two data sets
a={1,2,3,4,5}
b={6,7,8,9,10}
Mathematica will translate the sets as
a = {1,1},{2,2},{3,3},{4,4},{5,5}
b = {1,6},{2,7},{3,8},{4,9},{5,10}
I want to do a scatter plot and find the regression line. I know how to do a scatter plot but I am not sure how to do a regression line for both data sets.
I looked around and it was suggested to me that I can use this
regline = Fit[Join{a,b},{1,x},x]
Show[ListPlot[{a,b}], Plot[{regline}, {x, 0, 10}]]
This works but the "Join" makes the data sets A and B like this
{1,2,3,4,5,6,7,8,9,10}
and translates to this.
{1,1},{2,2},{3,3},{4,4},{5,5},{6,6},{7,7},{8,8},{9,9},{10,10}.
Wouldn't the regression line need to be figure out on the data sets
{1,1},{2,2},{3,3},{4,4},{5,5}
{1,6},{2,7},{3,8},{4,9},{5,10}
and not
{1,1},{2,2},{3,3},{4,4},{5,5},{6,6},{7,7},{8,8},{9,9},{10,10}.
The regression line would be different for both.