Summary Statistics (Analysis) 

Release 9.3
Last modified January 11, 2011 
Print all topics in : "Tools" 
NOTE: This topic was updated for 9.3.1.
This calculates summary statistics for field(s) in a table.
Usage tips
The Output Table will consist of fields containing the result of the statistical operation.
The following statistical operations are available with this tool: Sum, Mean, Maximum, Minimum, Range, Standard Deviation, Count, First, and Last. The Median operation is not available.
A field will be created for each statistic type — field operation — using the following naming convention: SUM_FIELD, MAX_FIELD, MIN_FIELD, RANGE_FIELD, STD_FIELD, FIRST_FIELD, LAST_FIELD, COUNT_FIELD. The field name is truncated to 10 characters when the Output Table is a dBASE table.
If a Case field is specified, statistics will be calculated separately for each unique attribute value. The Output Table will contain only one record if no Case field is specified. If one is specified, there will be one record for each Case field value.
Null values are excluded from all statistical calculations. For example, the AVERAGE of 10, 5, and NULL is 7.5 ((10+5)/2). The COUNT tool returns the number of values included in the statistical calculation, which in this case is 2.
The Statistics Field(s) parameter Add Field button is used only in ModelBuilder. In ModelBuilder, where the preceding tool has not been run, or its derived data does not exist, the Statistics Field(s) parameter may not be populated with field names. The Add Field button allows you to add expected field(s) so you can complete the Summary Statistics dialog box and continue to build your model.
Current map layers may be used to define Output Table. When using layers, only the currently selected features are used in the SUMMARY STATISTICS operation.
The following environment setting affects this tool: Configuration Keyword.
Command line syntax
An overview of the Command Line window
Statistics_analysis <in_table> <out_table> <statistics_fields {Statistic Type};statistics_fields {Statistic Type}...> {case_field}
Parameter  Explanation  Data Type 
<in_table> 
The input table containing the field(s) that will be used to calculate statistics. The input can be an INFO table, a dBASE table, an OLE DB table, a VPF table, or a feature class.

Table View  Raster Layer 
<out_table> 
The output dBASE or geodatabase table that will store the calculated statistics.

Table 
<statistics_fields {Statistic Type};statistics_fields {Statistic Type}...> 
The numeric field containing attribute values used to calculate the specified statistic. Multiple statistic and field combinations may be specified. Null values are excluded from all statistical calculations. The Add Field button, which is used only in ModelBuilder, allows you to add expected field(s) so you can complete the dialog box and continue to build your model. Available statistic types are

(Field String; Field String;...) 
{case_field} 
The fields in the Input Table used to calculate statistics separately for each unique attribute value (or combination of attributes values when multiple fields are specified).

Field 
workspace d:\project93\data\Montgomery.mdb Statistics customers customer_stat "SALES min; SALES max" TYPE
Scripting syntax
About getting started with writing geoprocessing scripts
Statistics_analysis (in_table, out_table, statistics_fields, case_field)
Parameter  Explanation  Data Type 
in_table (Required) 
The input table containing the field(s) that will be used to calculate statistics. The input can be an INFO table, a dBASE table, an OLE DB table, a VPF table, or a feature class.

Table View  Raster Layer 
out_table (Required) 
The output dBASE or geodatabase table that will store the calculated statistics.

Table 
statistics_fields (Required) 
The numeric field containing attribute values used to calculate the specified statistic. Multiple statistic and field combinations may be specified. Null values are excluded from all statistical calculations. The Add Field button, which is used only in ModelBuilder, allows you to add expected field(s) so you can complete the dialog box and continue to build your model. Available statistic types are

(Field String; Field String;...) 
case_field (Optional) 
The fields in the Input Table used to calculate statistics separately for each unique attribute value (or combination of attributes values when multiple fields are specified).

Field 
# Purpose: Determine the area by vegetation type within 100 meters of all stream crossings # Create the Geoprocessor object import arcgisscripting gp = arcgisscripting.create() try: # Set the workspace (to avoid having to type in the full path to the data every time) gp.Workspace = "c:/projects/RedRiverBasin/data.mdb" # Process: Find all stream crossings (points) gp.Intersect("roads ; streams ", "stream_crossings", "#", 1.5, "point") # Process: Buffer all stream crossings by 100 meters gp.Buffer("stream_crossings","stream_crossings_100m", "100 meters") # Process: Clip the vegetation feature class to stream_crossing_100m gp.Clip("vegetation", "stream_crossings_100m", "veg_within_100m_of_crossings") # Process: Summarize how much (area) of each type of vegetation is found within 100 meter of the stream crossings gp.Statistics("veg_within_100m_of_crossings", "veg_within_100m_of_crossings_stats","shape_area sum","veg_type") except: # If an error occurred while running a tool, print the messages. print gp.GetMessages()