Written by: STATISTICA 9/16/2009 4:41 PM
Recording an analysis macro in STATISTICA is incredibly easy, because the program does all the work for you.
When running analyses in STATISTICA, all options and output choices are automatically recorded; when you create a macro, the complete recording of all your actions are translated into a STATISTICA Visual Basic program that can be run to recreate the analysis. This facility is very useful in at least three ways:
This example illustrates how to create an analysis macro from an elementary analysis. For simplicity, a data file from the STATISTICA examples is being used, and a Descriptive Statistics analysis will be produced, but you can use any data set and analysis of your choice and still easily create the macro following these instructions.
Start STATISTICA, open the example data file 10Items.sta, and select Basic Statistics/Tables from the Statistics menu.
In the Basic Statistics and Tables Startup Panel, select Descriptive statistics and click the OK button.
In the Descriptive Statistics dialog, click the Variables button, select all variables for the analysis, and click OK.
Then, click the Summary: statistics button to display the descriptive statistics summary spreadsheet. When the spreadsheet is displayed, the Descriptive Statistics dialog is minimized on the Analysis bar. Click the Descriptive Statistics button on the Analysis bar to maximize the dialog.
Next, select the Normality tab, and click the Histograms button; histograms for all variables will be computed.
The STATISTICA Visual Basic code that will reproduce this analysis, which has been "accumulated" by the program, can be displayed in the STATISTICA Visual Basic Editor two ways. If the current analysis dialog is minimized, right-click on the button representing the current analysis on the Analysis bar, and select Create Macro from the resulting shortcut menu.
Alternatively, with the analysis dialog maximized, click the Options button and select Create Macro from the resulting menu.
After you select this option, the New Macro dialog is displayed.
Enter a name for the macro, and click the OK button. The macro will be displayed in a stand-alone window.
To run this macro, press F5 on your keyboard, or click the Run Macro button on the Macro toolbar.
The analysis will be recreated just as when you manually produced it.
Stand-alone macro programs must be loaded before they can run, while global macro programs (created by selecting Save As Global Macro from the File menu) become part of STATISTICA; that is, they will automatically be loaded the next time you run STATISTICA.
By default, global macros will be available in the Macro Manager dialog (accessed by selecting Macros from the Tools - Macro submenu). Global macros are the same as standard macros or SVB programs except that they are located in the same directory (by default) where the STATISTICA startup program file is located. When you select Save As Global Macro from the File menu, this directory will automatically be preselected. Save your frequently used macros via Save As Global Macro so that they are readily available when you start up STATISTICA the next time.
SB
0 comment(s) so far...