|
![]() |
|||
Visualizing DataCreating a GraphFor our purposes a graph requires two columns of data, the input and the corresponding output from a function. Examples of how to set this up can be found on Page 2. Graphs can be relatively simple or fairly elaborate (with labels for the data and axes, a title, a legend, and various gridlines and tickmarks), but we will stick with the basics. All we need to do is select the x and y ranges (together or separately, holding down the CTRL key) then click on the Chart Wizard (the button with an icon representing a bar chart).
You will notice that it automatically generated a title
and a legend, using whatever label you typed at the top of the y column.
The legend is useful if you have more than one y column to display (they
will show up with different colors and point styles), otherwise you can
just click on it and hit the DELETE key to get rid of it. Manipulating Graphed DataHaving created a chart, once you click on it to select it, several things happen. First the chart sprouts "resize" handles that you can drag to modify the dimensions of the chart. Second, a Chart menu appears on the menubar. Under this menu are a number of formatting options, with which you can always go in and add stuff that you skipped in the initial Chart Wizard by clicking Finish right away. You can also get to these options by right-clicking on the chart. Finally, you will see colored borders appear around the data that the chart uses. If the data in these highlighted ranges changes, then the graph will change (useful for experimenting). But even more useful, if you should decide to add a few more x and y values in your columns, you can stretch the colored borders to include the new points by dragging down on one of the bottom handles. If you want to restrict your graph to the same number of points but use different ranges you can just click on the edge of the border and drag it to highlight a different set of points. If you want to add a whole new column of y values next to the original one you can stretch the highlighted border sideways by dragging the right corner to include the new column of data. Graphs with Multiple FunctionsAs indicated right above, if you want to compare two functions on the same graph (either to see how they are different or to see where they intersect), you would generate three columns of data. One column would be the x as before, and then there would by two y columns, one for each function. You can generate these y columns with different calculations.
If you already have a graph with one set of data and you
want to add another you can either do it using the handles on the blue
border highlighting the one column of y values and drag it to include
the other column, or you can use the Add Data... option on the Chart menu.
This will explicitly ask you for the range of addresses (e.g., C2:C8 here)
where it can find the new set of y values. You can either type in the
addresses manually or go out and select them with the cursor. Finding Equations from Graphs
You will be presented with several different possible types of functions. Some of them are already ruled out because of the way they behave when x=0. However, you need to have some idea what your function does or should look like. Most of the time we are interested in a "linear regression," the first option, which is the straight line that comes closest to all the points.
It is possible to put more than one trendline on the same
chart, just repeat the process for whatever kinds of functions you think
might work. When you are done you can look at them and decide which one
does a better job describing the data. In the example below a linear function
and an exponential function were attempted and it is fairly clear that
the curved exponential function matches the levelling off effect in the
data better. You can get a quantitative measurement of how good your function
is by checking the "Display R-squarted value on chart" under
the Options tab. The closer to 1.0 this value is, the better your function
matches your data.
Some Sample Exercises
|
||||
Contact Leo Wibberly at ldwibber@vcu.edu or (804) 740-4650 to make appointments |