Hi There!
I have 10 Y measurements all against one X, how do I compare the responses on one graph using the linear regression lines (on the scatterplots)? The Y are in triplicates. I have attached the Excel file with the data.
There are three ways that you use to 'compare' the 10 regressions. You need to stack the ten Y columns first for all ten of them to work.(Select Tables > Stack) Try these methods with the stacked data table:
Thank you very much both methods have worked very well. I have two more questions,
1. How do I format the Y and X axis titles, I have been able to change the naming but not able to bold or increase the font size. Formaing the Y and X axis scale I have managed.
2. Is it possible to obtain the Equation of each of the line fitted in the model? How do I do that?
Hi Jim,
There really isn't a graphic, it's just equations. If you run your example with the first method and get the graph, each set of x,y pairs gets its own LSQ fit line. Instead I want to fit a line to each set of data but the lines have the same slope. There are cases where this makes sense physically. The slope corresponds to the population standard deviation of which there can only be one value.
The resulting graph would show a fit line through each set of x,y pairs but the slopes are the identical. There is one LSQ fit that minimizes the error given this constraint. (The error is larger than letting each line have it's own optimal slope of course.)
In matlab, you specify a linear equation for each set but the slope variable is the same for both sets. Instead of 4 degrees of freedom you have only 3. Intercept 1, intercept 2 and the slope. But it's very tedious getting data from a datatable, into Matlab and reformatting it so it can be processed by the lsqcurvefit function.