Visualize Item Distribution with GRAPH
Question: How can I analyze the frequency or correlation of numeric animal items (like Days in Milk or Milk Production) in DC305?
Answer: Use the GRAPH command to display the relationship between one or two numeric items (not events) on a graphical basis.
GRAPH provides two main types of visual analysis:
-
A bar graph showing the frequency or quantity of an item (such as milk values).
-
A scatter plot showing the correlation between two items. This function uses any numeric item (for example, MILK, DIM, or DOPN).
You can run the GRAPH function using a selection window to choose your parameters (items, range, etc.) for analysis, or you can add your parameters to the GRAPH command directly in the command line.
The easiest way to select items and set analysis parameters is by using the item selection window. To open the window, enter GRAPH in the command line.
From here you choose the item(s) you want to analyze. Use the search bar at the top of the window to find the applicable items.
To create a bar graph showing the frequency distribution of a single item:
-
Select the item you want to analyze from the window, then click OK.
-
When prompted to select a second item, click Cancel (or press Escape). Do not select a second item.
Your bar graph displays, showing the following information:
- The bottom axis (i.e., x-axis) shows the item type you selected, along with the range of item values over which the data is distributed. The bars of the graph are centered over the specific value (or range of values) on the axis.
- The left-side axis (i.e., the y-axis) always shows the COUNT of animals. That is, the number of animals in the herd whose item value falls into the corresponding position on the x-axis.
To investigate or "drill down" to see the individual cows that make up a specific bar, double-click the bar you want to analyze.
When you double-click a bar, the bar graph closes, and DC305 automatically runs a SHOW command. This generates a detailed, filtered list of the individual animal IDs that contributed to that specific bar segment.
-
The list is automatically filtered to include only animals whose value for the x-axis item (for example, Days Carried Calf) precisely matches the value or range you selected.
-
The resulting output is a list of ID numbers for the animals, allowing you to easily look up their CowCards or perform further analysis on that specific subgroup.
To create a scatter plot showing the correlation between two items:
- From the selection window, choose the first item you want to analyze and click OK.
- Choose the second item you want to analyze and click OK again.
Your scatter plot displays, showing a visual representation of the correlation between the two items you chose:
-
Each point of the scatter plot represents a single animal.
-
The x-axis displays the range of values for the primary item (i.e., the first item you selected).
-
The y-axis displays the range of values for the secondary item.
A scatter plot is designed to visualize individual animal data points showing the correlation between two items. To investigate an individual animal and its data, double-click the applicable point (dot) on the scatter plot. DC305 will automatically switch you to the animal's CowCardtab, which is the detailed record view. You can return to the graph at any time by pressing Escape or clicking the Graph tab.
This allows you to quickly view all of the animal's events, health history, breeding information, and other details to investigate why that particular animal falls at that specific intersection of the two plotted items.
The command line is the fastest way to run and customize a graph without using the selection prompts. The basic structure for running GRAPH is: GRAPH [X-Item] BY [Y-Item] FOR [CONDITION] \ [SWITCHES]
You can use a BY statement to segment and color-code the graph by a third item (up to two are allowed).
For example, running GRAPH MILK BY DIM LACT FOR LACT>0 results in a scatter plot of MILK vs. DIM, where each lactation (LACT) is shown in a separate color.
You can combine multiple switches at the end of a command without any spaces (for example, \ARZ).
-
\A (Graph Averages): Creates a line graph displaying the average y-axis value for each x-axis interval, rather than individual points.
-
\R (Regression): Adds a calculated regression line to a scatter plot.
-
\S (Survival Graph): Creates a survival curve for time-to-event items.
-
\Z (Include Zeroes): Ensures animals with a value of zero for the plotted item are included in the averages or counts.
-
\H (Histogram): Forces the output to a histogram/frequency distribution, even if a BY item is specified.
-
\M (Match Axes): Forces the x and y axes to use the same limits.
-
\B (Both Live and Dead): Includes both live and dead/sold animals in the analysis. This is important for analyzing historical distributions.
-
\D (Dead/Sold Only): Includes only dispositioned (dead/sold) animals in the analysis.
-
\X# (x-axis Max Value): Sets the maximum value for the x-axis. For example, \X400 sets the x-axis maximum to 400.
-
\Y# (y-axis Max Value): Sets the maximum value for the y-axis. For example, \Y200 sets the y-axis maximum to 200.
You can print the contents of most pages by clicking the Print button
on the toolbar or selecting Print from the File menu.
Charts and graphs always print in graphic mode and in color if your printer supports it.