Statistica Object Model

The Statistica Object model is a COM-based application programming interface (API) that allows programmatic access to all Statistica applications. Everything that can be accomplished interactively in the program can be achieved through the Statistica API. Since the API is based on Microsoft COM technology, it allows the interface to be exposed to all external programs that support COM. This includes scripting languages (e.g., VBScript, Perl, PowerShell) as well as native high-level languages (e.g., c++) and all .NET languages (e.g., C#, Visual Basic, ASP.NET) via the .NET–COM interop layer. In addition, this API is accessible via scripting within the Statistica itself. This includes scripting languages such as Statistica Visual Basic, C#, R, Python, and others.

The Statistica Application Programmer's Interface (API) offers a rich object model that grants you access to all the functionality available to Statistica interactively. Anything that can be performed through Statistica's interface can also be programmed. Statistica's object model is designed to mirror its user interface. For example, there is a class for every analysis dialog box; additionally, each of these classes encompasses all the successive properties that you would find in the respective dialog box.

To simplify Statistica programming, all analysis and graph creation scripts can be recorded for you, saving you valuable time and effort by turning repetitive tasks into simple, automated procedures. After selecting any of the analyses from the Statistics, Data Mining, or Graphs tab, all actions such as variable selections, option settings, output, etc., are recorded. You can transfer this recording to the Statistica Visual Basic editor window at any time; this is accomplished by selecting Create Macro from the Options button menu available in all analysis and graph dialog boxes.

Even multiple analyses can be recorded by creating a master macro. You can record a master macro of your entire session that can consist of several analyses and graphs; this recording will connect all analyses performed from the Statistics, Data Mining, or Graphs tabs. The master macro recording will begin when you turn on the recording, and it will end when you stop it. In between these actions, all file selections, analyses, and most data management operations (e.g., stacking/unstacking) are recorded. Once you are finished, you simply stop the recording and an SVB macro will be created with all of your analysis and data management operations generated for you.

Along with analyses and graphs, Statistica's object model also exposes all of its document types; you can easily customize a graph, manipulate data in a spreadsheet, format a report, and organize a workbook via automation.

This documentation is organized by object type. The Application object is the main Statistica application object; creating one of these will instantiate a Statistica application or library, and all other objects should be created from this object. The Spreadsheet is the Statistica document that is the data container for the Statistica application. The Report is a document that can contain tabular text and graphics summarizing analysis results. The Workbook is a document type that contains hierarchical nesting of other Statistica objects in a tree view. The Macro is a document representing a Statistica Visual Basic program.

Graphs has a special category with all its extensive objects to create and customize Statistica Graphs.

The Statistics category contains the objects that represent all the different analysis types.

Enterprise-level products are organized into separate categories. These include Statistica Enterprise, SDMS, and Statistica Server.

C# Examples

  • Converting a spreadsheet to tabular text
  • Creating and Editing a Box & Whisker Plot in C#
  • Creating a Range Plot from a C# node
  • Generating an Enterprise users report
  • Using a custom parameter in a C# node

C++ Examples

  • Exporting a Spreadsheet as Text in C++
  • Running Basic Statistics in C++

R Examples

  • Generating Statistics from an R node

R Examples

  • Accessing Workbook items by name
  • Adding a custom toolbar
  • Adding a data configuration
  • Adding a document-level event to a graph
  • Adding a document to Enterprise
  • Adding a folder
  • Adding a formula
  • Adding a group
  • Adding a header, based on the name of the first item
  • Adding and customizing an arrow on a graph
  • Adding and removing custom layouts
  • Adding and running document-level event code in a spreadsheet
  • Adding and running document-level events in a workbook
  • Adding an external data source
  • Adding an item to a report
  • Adding an SVB analysis configuration
  • Adding a Quality Control analysis configuration
  • Adding a report
  • Adding a station
  • Adding a text label
  • Adding a user
  • Adding a Win32 function to SVB
  • Adding cases and variables to a spreadsheet
  • Adding custom hot keys
  • Adding event code to a report
  • Adding formatted headers to a report
  • Adding print headers and footers
  • Adding shapes to a graph
  • Advanced queries using the Statistica OLE DB provider
  • Analyzing a mapped subset
  • Applying a layout to a spreadsheet
  • Approving a document via SDMS
  • Backing up a workbook document
  • Changing an analysis's output settings
  • Changing a variables type
  • Changing case names
  • Changing graph options
  • Changing how items are added to reports
  • Changing how spreadsheets within reports are printed
  • Changing login constraints
  • Changing the coordinate system of a graph
  • Changing the font formatting for new reports
  • Changing the foreground and background colors of a graph
  • Changing the global spreadsheet number format
  • Changing the graph sizes within reports
  • Changing the image format within reports
  • Changing the graph sizes within reports
  • Changing the internal formatting of reports
  • Changing the graph sizes within reports
  • Changing the spreadsheet sizes within reports
  • Changing where temporary copies of spreadsheets are saved
  • Checking in a document to SharePoint
  • Closing all open analyses
  • Combining date variables
  • Combining multiple graphs
  • Combining multiple plots into one
  • Computes descriptive statistics of variables
  • Concatenating variables
  • Converting text values into dates
  • Copying and pasting items from a workbook
  • Copying a spreadsheet
  • Creating a (systematic) random sample (advanced)
  • Creating a custom audit log report
  • Creating a documents version report for a folder
  • Creating and analyzing a streaming DB connection
  • Creating a new macro from a template macro
  • Creating a new project
  • Creating a new workbook
  • Creating an object report
  • Creating a random sample
  • Creating a random sample (advanced)
  • Creating a stratified random sample
  • Customizing a 2D graph
  • Customizing a 3D histogram
  • Customizing a graph's title
  • Customizing display attributes
  • Customizing paragraph formatting
  • Customizing program options
  • Customizing the background
  • Customizing the case weight options for an analysis
  • Customizing the default spreadsheet layout
  • Customizing the ribbon
  • Customizing variable names
  • Data Entry Example 1: Adding labels for data entry
  • Data Entry Example 2: Adding a characteristic for data entry
  • Data Entry Example 3: Adding a data entry setup
  • Data Entry Example 4: Entering data samples
  • Data Entry Example 5: Adding a Quality Control analysis configuration
  • Data Entry Example 6: Running the QC analysis configuration
  • Data Entry Example 7: Adding a report
  • Data Entry Example 8: Adding a taskset
  • Data Entry Example 9: Adding a MAS dashboard
  • Data Entry Example 10: Searching samples for a pattern
  • Data Entry Example 11: Searching for sample inconsistencies
  • Data Entry Example 12: Updating and Bumping an object's SDMS version number
  • Deleting an item from a workbook
  • Deleting cases and variables from a spreadsheet
  • Displaying a progress bar
  • Editing a data configuration's query
  • Editing an item in a report
  • Editing cells
  • Editing documents in a workbook
  • Enabling case weighting
  • Estimate the parameters of the Johnson distribution by percentiles
  • Exporting a spreadsheet as an Excel file
  • Exporting a spreadsheet as XML
  • Extracting data from Statistica Enterprise
  • Filling a spreadsheet with random data
  • Finding additional text in a report
  • Finding text in a report
  • Finding the line number from a character position
  • Formatting a formula to work under different locales
  • Formatting a paragraph
  • Formatting the font in a report
  • Generating a report from R data & output
  • Getting a character count of each line in a report
  • Getting the number of characters in a report
  • Getting the selected text from a report
  • Getting the unique values from a spreadsheet
  • Importing an Excel file as a spreadsheet
  • Importing an Excel file as a workbook
  • Importing fixed text
  • Importing text
  • Inserting a folder into a workbook
  • Inserting a new item into a workbook
  • Inserting an item into a workbook
  • Interactively deploying and updating a workspace
  • Interactively selecting a folder
  • Limit the number of warning messages queued from an analysis
  • Logging messages and reviewing the debug log
  • Looping through items in a workbook
  • Marking and unmarking cells
  • Merging spreadsheets by text values
  • Merging spreadsheets by variables
  • Moving cases and variables
  • Moving the contents of one folder to another
  • Opening and running another macro
  • Opening an Office document in Statistica
  • Opening a spreadsheet from Enterprise
  • Optimizing spreadsheet queries using cached DB connections
  • Outputting an analysis's results
  • Pasting a spreadsheet's content into a report
  • Pasting a spreadsheet into a graph
  • Pasting a spreadsheet into a workbook
  • Printing an item from a workbook
  • Prompting the user for a spreadsheet
  • Querying data from PI databases
  • Recoding data
  • Removing commands and comments from an R console report
  • Removing missing-data cases from a spreadsheet
  • Removing text labels
  • Removing the selected item or text in a report
  • Replacing all instances of a string in a report
  • Replacing missing data
  • Replacing text in a report
  • Replacing the content of one graph with another
  • Retrieving and assigning data
  • Retrieving and copying case data
  • Retrieving and copy variable data
  • Retrieving and copy variable data (with missing data removed)
  • Retrieving text label information
  • Retrieving the text of a cell
  • Reverting a document via SDMS
  • Reviewing a case's weighting and case selection
  • Reviewing warnings from an analysis
  • Running an SVB analysis configuration
  • Running a query
  • Save every open spreadsheet
  • Saving a backup of a graph
  • Saving a backup of a report
  • Saving all open graphs
  • Saving all open workbooks
  • Searching for an item by name recursively
  • Selecting a range of cells
  • Selecting a range of cells in a spreadsheet
  • Setting an analysis's output to report
  • Setting cells to missing data
  • Setting custom application properties
  • Setting Enterprise's DB as data source for DE Setups
  • Setting the margins
  • Setting the selected text in a report
  • Shifting variables
  • Sorting variables
  • Splitting a spreadsheet via random sampling
  • Stacking a dataset
  • Standardizing variables
  • Storing and retrieving values in the global dictionary
  • Subsetting data
  • Suppressing analysis warnings
  • Tiling all open windows
  • Time stamping all open macros
  • Timestamping each item in a workbook
  • Tracing a call stack
  • Transforming data via multiple formulas
  • Transposing data
  • Unstacking a dataset
  • Using a specific version of an Enterprise object
  • Using matrix functions
  • Using the statistics library