Linear Regression Line with Equation
This tutorial will show how to use the TechGraph Editor to fit a linear regression line to a set of XY data points. A regression line is drawn through the XY data. A linear equation that shows the y-Intercept and slope values is displayed as well. Shown below are the settings in the Data Table and the Edit Chart used to create this chart.
Data Table – Sample data can easily be changed or replaced by pasting data from an external worksheet.
- Graph Type is Scatter.
- X Data Type is Number. X Data column contains the X values.
- Graph A series is set to Scatter and it contains the Y values.
Note: Click on the “Help” button on the toolbar to find out how to edit, delete, copy and paste in the Data Table.
Edit Chart – A set of icons (Titles, Settings, X Axis, Y Axis, Curves and Error Bars) to change the settings and appearance of the chart.
Settings – specify the color, marker type and size for Graph A marker.
- Click on the “Crimson Circle” (Graph Style) to show the marker Style for Graph A pop-up. You can change the Color, Type and Size for Graph A marker. Click on Apply to save the changes.
X Axis
- Enter values in Minimum, Maximum and Major Div to set the X Axis scale and divisions. Leave these values empty for automatic scaling.
Y axis
- Enter values in Minimum, Maximum and Major Div to set the Y Axis scale and divisions. Leave these values empty for automatic scaling.
Curves & Error Bars
- Click on “Linear” (Curve Fit) for Graph A to show the Curvefit Selection for Graph A pop-up. For this example, “Linear” is selected from the Selection list. Checkbox for Show Curve Fit Equation and Show Curve Fit Legend are checked. Click on Apply to save the changes.
- Click on Curve Style for Graph A to show the Curve Style for Graph A pop-up. Curve Color (“black”) is selected for the regression line color. Use the Thickness and Line Type selection list to change the line style. Click on Apply to save the changes.
Note: To move the location of the linear equation – click on the equation and it will be outlined with “bubbles”. Grab the center bubble and move to the desired location. Edit Chart Toolbar Options
- Print Chart prints your chart.
- Download Image downloads your chart as an SVG(Scalable Vector Graphics) file or image file(PNG, JPEG, TIF, PDF).
- Drawing Objects customize your chart with labels, lines, arrows, circles, images, and logos.
Getting Started:
- Data Table, Fill Data, Data Transform, Linear Curve Fitter, Nonlinear Curve Fitter
- Edit Chart, Drawing Objects, Chart Setup
- Titles, Settings, X Axis, Y Axis, Curves and Error Bars