Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


For the first task, I made a method that updates the linear regression line. It is called if there is a line present, and then it, like other update methods, multiplies the points of the current object by the vtm, effectively scaling it to the screen. The second task just asks to test this function to see if the line moves correctly. The result of testing it on data-simple.csv is below. We also needed to make sure that canceling the regression didn't mess anything up, so instead of what I did before, with taking action after the dialog box closes, to taking action if ok is pressed.
This is the window that pops up when choosing what data to use for the linear regression:

Task 3 was to create the linear_regression function in, which returns the information about a header's column in relation to two independent variable columns. I followed the provided information to create the method. We calculate such things as standard error, the r^2 value, and the degrees of freedom by manipulating the columns of data. Below is the result of running it on the three provided files:

The last task was to find a dataset online with a strong linear relationship and test our linear regression and our multiple regression function on it. I found data on work-related info, including hours worked part time, debt, and women's and men's wages. Here is a linear regression showing the relationship between debt and part time. It appears that the more part time hours are worked, the more debt accrued, although there is a cluster of debt with almost no part time hours worked near the bottom left, too. Overall, the line shows that there is a fairly even distribution in the data. (Amount of debt is the x axis, and part time hours worked is the y.)