Mathematica: Hubble
Enter the Hubble data hubble = {{0.032, 170}, {0.034, 290}, {0.214, -130}, {0.263, -70}, {0.275, -185}, {0.275, -220}, {0.45, 200}, {0.50, 290}, {0.50, 270}, {0.63, 200}, {0.8, 300}, {0.9, -30}, {0.9, 650}, {0.9, 150 }, {0.9, 500}, {1, 920}, {1.1, 450}, {1.1, 500}, {1.4, 500}, {1.7, 960}, {2, 500}, {2, 850}, {2, 800}, {2, 1090}}
Make a ListPlot of the Hubble data
Click on the label button from the suggestions that arise
Result of adding labels
Use the LinearModelFit – linear here means that it is linear in the fit parameters
The ParameterTable option gets some of the statistical measures for the fit
Use Normal to extract the simple fit formula from all the associated statistical data. Then plot the fit function
Use Show to put the ListPlot of the data and the Plot of the fit formula together
We can get the equation displayed as well