The question states:

Plot the regression line from D = 40 to D = 300.

My question:
Do you extend the line beyond those 2 points (as in going towards the axis) or does the regression line just connect those 2 points like a line segment?

plot it from point to point

When plotting a regression line, it is generally assumed that the line extends beyond the given data points. The regression line represents the best fit line that describes the overall trend of the data. Therefore, it is useful to extend the line beyond the given data range to see if it continues to follow the established trend.

In the case of the question you mentioned, where the regression line is plotted from D = 40 to D = 300, you would extend the line beyond these two points on both ends. The extension helps to visualize whether there is a clear pattern in the data and if the trend continues outside the given range. However, it is important to note that the further you extend the line from the data range, the more uncertain and speculative it becomes.

To plot the regression line, you would typically use a statistical software or programming language that provides regression analysis capabilities. This allows you to calculate the slope and intercept of the line based on the given data points and determine the equation of the regression line. Once you have the equation, you can plot the line by selecting a range of values for D and calculating the corresponding values of the dependent variable (usually denoted as y). These calculated points can be connected to create the regression line on a graph.