STATPK Statistical Analysis and Plotting Users Guide 

Table of Contents 
Ravi Kochhar Department of Physiology University of Wisconsin Madison, Wi. 53706 Technical Report no. 9 Jan. 21, 1977 Rev. 2.026, July 28, 2005 
Introduction
STATPK is a program for data analysis and plotting. It is used primarily by users of the Auditory Lab for data plotting and management, but can also be used for more general purposes.
STATPK is controlled by a user commands, typically typed in at the keyboard, but commands can also be stored in a file on disk as "command macros" which can then be executed by a single command (EM). The list of currently available commands is given below.
STATPK is available for VMS (VAX and AXP) and MS Windows/NT/2000. Differences between the two versions are noted below where applicable.
SPECIFY COMMANDS  DF @@@@@@ Specify the Data File name. LIST [#1 #2] List summary table of data file contents (42) VER Show STATPK version number CR @@@@@@ [#] Create a new data file on disc with name @@@@@@ and (optional) max. # of datasets. (23) DS #1,...,#n Select one or more dataset numbers to be included in the analyses. DS # [TO #2] Select a range of dataset numbers. DS 0 Cancel the previous DS command. IV #l,...,#n Specify the variable(column) numbers to be used as the Independent Variable (i.e. along X) (128).(4,44) DV #l,...,#n Specify the variable (column) numbers to be used as Dependent Variables (i.e. along Y) (128).(4,25) * Noop, comment line, ignored by STATPK (66) // Noop, comment line, ignored by STATPK (66) XV # Same as IV above. YV #l,...,#n Same as DV above. VX # Same as IV above. VY #l,...,#n Same as DV above. ZV # Specify Zvariable column number. DH # Dataset no. of histogram (for OU SH).(29) HD # Same as DH above. HV # Variable no. of histogram (for OU SH).(29) VH # Same as HV above. NX DS [NOT=#] Specify the next data set number.(45,46) NX DV [NOT=#] Specify the next dependent variable.(46) NX IV [NOT=#] Specify the next independent variable.(46) OR # Specify Order of Polynomial Regression (15). OD [PR/PL/TE/FIL] Output to be on Printer/Plotter/Terminal/File. GT [NG/OG/TE] Specify type of graphics device to be one of NewGraphics, OldGraphics or Tektronix.(24) DA [TE/FI] Data to be input from TERMINAL/DATAFILE. XN # [OV/FX] Specify min. scale value along Xaxis.(17,37) XM # [OV/FX] Specify max. scale value along Xaxis.(17,37) YN # [OV/FX] Specify min. scale value along Yaxis.(17,37) YM # [OV/FX] Specify max. scale value along Yaxis.(17,37) ZN # [OV/FX] Specify min. scale value along Zaxis.(17,37) ZM # [OV/FX] Specify max. scale value along Zaxis.(17,37) AUTO Auto Scaling for Plots (65) XN DEF Autoscale Xmin (65) XM DEF Autoscale Xmax (65) YN DEF Autoscale Ymin (65) YM DEF Autoscale Ymax (65) ZN DEF Autoscale Zmin (65) ZM DEF Autoscale Zmax (65) TR X [#3 [#4 [#5]]] Transform the X variable before analysis. The transformation code is #3 optionally, and the transformation parameters may be specified as #4 and #5.(51) TR Y [#3 [#4 [#5]]] Same as "TR X ..." above but for Yvar. TR NO Cancel the "TR X" and "TR Y" commands. XX LOG Specify Log axis for XVariable. XX LIN Specify Linear axis for XVariable. YX LOG Specify Log axis for YVariable. YX LIN Specify Linear axis for YVariable. INC # Specify Increment to be used along Xaxis while plotting the regression curve. NV # Number of Variables (Columns) in current data set. SET DEF Set all parameters to their default values. HELP List all available commands. TI YES Titles along X and Yaxes wanted with plot. TI NO Titles not wanted with plot. TI X @@@@@@ Specify title to be displayed along Xaxis TI Y @@@@@@ Specify title to be displayed along Yaxis TI Z @@@@@@ Specify title to be displayed along Zaxis LW LI #1 #2... #n Line weights for upto 28 plotted lines.(35) LW SY #1 #2... #n Specify line weigths for upto 28 symbols. LW @@ # Specify the line weights for plot.(30) # is the line weight (0 to 10), and @@ can be any one of : BX : Bottom axis TX : Top axis XX : Both BX and TX LX : Left axis RX : Right axis YX : Both LX and RX AX : All axes HI : Histogram bins TI : Titles along axes MS : Messages LA : Axes labels BL : Bottom labels LL : Left Labels ZL : Zaxis Labels SD : Standard dev. bars or lines HSD : Hosrizontal std. dev. bars CAP : Caption(s) GX : Xgrid GY : Ygrid GR : Both grids LG : Page Legend TA : ID Table TABH : Table Header XYPROJ: Projection on XY plane XZPROJ: Projection on XY plane YZPROJ: Projection on XY plane XYRAY : Projection rays to XY plane XZRAY : Projection rays to XY plane YZRAY : Projection rays to XY plane ALL : All the above LW @@ DEF Specify default line weight for any of above SZ @@ # Specify size (in inches) for any one of : XX : Xaxis YX : Yaxis ZX : Zaxis AX : All axes BT : Bottom title LT : Left title ZT : Zaxis title TI : Titles along all axes BL : Bottom labels LL : Left labels LA : Axes labels MS : Messages LG : Page Legend TA : ID Table TIC XX : Tic marks along Xaxis TIC YX : Tic marks along Yaxis TIC ZX : Tic marks along Zaxis TIC BX : Tic marks along Bottom axis TIC LX : Tic marks along Left axis TIC RX : Tic marks along Right axis TIC TX : Tic marks along Top axis TIC AX : Tic marks along All axes SD : Standard Deviation bars SZ @@ DEF Default size for any of the above. SZ SY #1 #2...#N Specify sizes of upto 40 symbols (in inches) SZ ALL DEF Default size for all of the above. PD YES Print date and time with plots. PD NO Do not print date and time with plots. LO #l,,#n Leave out point numbers #l,,#n from the analysis. Up to 10 points can be excluded with this command. This command should be used only when ONE data set is included in the current analysis.(10,11) SL # Specify the fixed slope value to be used with firstorder regression initiated by "OU RF".(12) IC # Specify the fixed intercept to be used with first order regression initiated by "OU RF".(12) GX # Number of grids along Xaxis (220). GY # Number of grids along Yaxis (220). NB # Number of bins for Histogram plots (2512).(16) BW # Specify binwidth for histogram plots.(16) DX # No. of digits after decimal on Xaxis labels. DY # No. of digits after decimal on Yaxis labels. AL YES Draw Averaged Line with scatter plots.(l9) AL ONLY Draw only the averaged line with s.p. AL NO Cancel the averaged line option AL SM [#] Averaged line to be smoothed using #point smoothing (3pt smoothing if # not given). AL SM 0 Do not smooth the averaged line. SF YES Do a separate fit for each data set specified (lst order regression only).(18) SF NO Cancel the separate fit option RV YES Reverse plot/message positions. RV NO Normal position for plot. MS YES Message wanted with plots. MS NO No message with plots. MS 2 2line message with plots. MS 1 lline message (same as MS YES) SD YES Show std. dev. bars with scatter plot.(27) SD NO Std. dev. bars not wanted. SY #l,...,#n Symbols to be used in data plots.(33) SY DEF Use default symbols. DL #l,...,#n Dashed line factors for data lines.(36) DL DEF Use default dashed line factors. HI SH [#] Shaded histograms wanted.(52) HI UN Unshaded histograms wanted. (52) SV [#] Save current parameter values.(38) RT [#] Retrieve previously saved parameter values.(38) RT Retrieve parameters for latest STATPK run. (39) WAIT Wait until the plotter is free. * Dummy command, ignored.(47) GV V#/C# @@@@@@ [NOT=#] Get the value for specified variable.(46,48) GV A# COL #1 #2 Get the contents of column #1 in dataset #2 (60) V# @ #l Perform the arithmetic operation @ (any one of +  * /) on V# and store the result back in V#. V# can be any one of : W,V0,Vl....V9 and #1 can be any number or any one of VV,V0,Vl,V2....V9. V# = #l Assign the value #l to the temp. variable V#. V# can be any one of VV,V0,Vl...V9 while #1 can be a number or any one of W,V0,Vl...V9.(49) IF V# @@1 ## @@@@2 If the value of V# satisfies the given condition then execute the command @@@@2. @@l can be any one of : EQ,NE,LT,LE,GT or GE. ## is the value to be compared, and it can be a number, an alpha string, or any one of : V0,Vl,V2.....V99.(50) SC SI/DO/TR Single, Double or Triple spacing for print output. COL @@ # Specify colors (58) @@ can be any one of: BX : Bottom axis TX : Top axis XX : Both bottom and top axes LX : Left axis RX : Right axis YX : Both left and right axes AX : All axes HI : Histogram SH : Histogram shading pattern TI : Titles along axes MS : Messages LA : Labels along axes SD : Standard deviation bars or lines TA : ID Table LG : Legend GX : Xgrid GY : Ygrid GR : Both grids ALL : All of the above COL @@ DEF Default color for any of the above COL LI #1 #2...#n Colors for upto 40 lines (58) COL SY #1 #2...#n Colors for upto 40 symbols (58) PX @@ # Xposition (in inches) of one of the following: PLOT : Plot axes CAP : Captions CAP1 : Caption number 1 CAP2 : Caption number 2 CAP3 : Caption number 3 CAP4 : Caption number 4 CAP5 : Caption number 5 MS : Messages MS1 : Message # 1 MS2 : Message # 2 MS3 : Message # 3 MS4 : Message # 4 MS5 : Message # 5 TAB : ID Table DATE : Date with plot ALL : All of the above PY @@ # Yposition for any of the above. PX @@ DEF Xposition to default PY @@ DEF Yposition to default CAP # Number of caption lines (0 to 5) (default is 0) XC @@@@@@ Execute specified external (i.e. DCL) command (59) SET YX LEFT/RIGHT/DEF Set axis along which Yvar will be plotted.(53) ML @@@@@ Set message level. @@@@@ can be any one of: NONE : Display no messages BRIEF : Display only error messages LONG : Display only warnings and error messages FULL : Display all messages The default is FULL. SEL [AND/NOT/ONLY] CN #1 @@ #2 Mark those points which meet the selection criteria as "selected". @@ can be one of: GT, LT, EQ, GE, LE or NE #1 is the column number, and #2 is a numeric value or variable. You must first specify the the data set(s) with the "DS ..." command SEL [AND/NOT/ONLY] PN #1 [#2] Select points with sequence numbers between #1 and #2 for current dataset(s) Select just point #1 if #2 is missing. SEL ALL/NONE Select or "deselect" all points in current dataset(s). NUM PBS # Number of "points between symbols" for scatter plots (64) MACRO COMMANDS  EM @@@ Execute the commands in macro @@@. GO # Branch unconditionally to record # in macro. RETURN Return to calling macro, or, if already at level1, then exit from STATPK. OUTPUT COMMANDS  OU RE Initiate Polynomial Regression Program.(18) OU RF Initiate FirstOrder Regression when either slope or intercept are to be held fixed.(12) OU HI Output Histogram plot.(14) OU HI BC Output Histogram plot from bin contents.(28) OU SP Output Scatter plot.(19,15) OU SH Output ScatterplotHistogram combination.(29) GR @@ Any of the above with Graphics output.(32) PL @@ Any of the above with Plotter output.(32) PR @@ Any of the above with Printer output.(32) DI @@ Any of the above with Terminal output.(32) SO @@ Any of the above with Spool File output.(32,54)) STORE COMMANDS  ST HI Store binned histogram back in data file.(40) ST AL Store the computed averaged line from scatter plot back in the data file.(41) EDITING COMMANDS  ADD Add a new Dataset to file.(6,8) IN [HEAD/MSG] @@@ Input (read) data from ascii file.(69) NV # Number of variables (columns) in data set. DE # Delete existing dataset from file.(7) CL FI Clear File, delete all data sets.(7) LP #l,...,#n List the points in datasets numbered #l,...,#n. AP # Add points to dataset number #.(6) DP #1 [TO #2] #3 Delete points #1 [to #2] in data set #3.(7,22) SP #1 #2 Sort points in dataset no. #1 using variable no. #2 as the key. (If #2 not specified then assume #2=1). CP #1 #2 Change point no. #1 in dataset no. #2. CP #1 [CN #2] #3 Change point no. #l in data set no. #3. Optionally specify the Column no. with CN so only single value is changed. CI # Change the ID for dataset number #. CS #l,...,#n Combine and Save. Combine datasets #l,...,#n to form a new dataset and save it in file. CC #1 #2 Combine the datasets #1 and #2 columnwise. IC #1 #2 #3 Interchange columns #1 and #2 in dataset no. #3. TS [REP] #1 #2 [#3 [#4 [#5]]] Transform column no. #l in data set no. #2. Optionally specify the transformation code #3 and the transformation parameters #4 and #5. If REP is used then replace col. #l with the transformed column, else store transformed column as an additional column.(51) TC [REP] #1 @ #2 #3 Apply the operation @ on the two columns #l and #2 in dataset no. #3. @ is any one of the following : + addition  subtraction * multiplication / division If REP is used then replace column #l by result column, else form resultant column as an additional column. RC # Interchange Rows and Columns in dataset # BELL YES Bell wanted as prompt while entering data. BELL NO Bell not wanted as prompt while entering data. EF Enlarge the Data File. SM [REP] #1 #2 [#3] Smooth data in column #1 of data set #2 using #3point smoothing. If #3 not specified then 3point smoothing. If REP is used then replace column #l with smoothed column, else form transformed column as additional column.(26) GC Garbage Collect i.e. Compress data file.(21) DC #1 #2 Delete Column #1 in data set #2. TD # @@@@@@ Transfer data set no. # to specified data file. AV Check available space in data file. DT #1 #2 #3 [#4] Differentiate the function in column no. #l of data set no. #3. The diff. is done w.r.t the function in col. no. #2. Optionally specify the window length (#4) for slope computation (default for #4 is 3).(43) FILT #1 #2 #3 #4 Filter a waveform with specified filter type(61) FFT #1 #2 #3 [#4 [#5]] Fast Fourier Transform of specified col.(62) IFFT #1 #2 #3 [#4 [#5]] Inverse Fourier Transform of specified col.(63) ACA #1 #2 [#3] Autocorrelation of amplitude data (67) ACS #1 #2 [#3] Autocorrelation of spike time data (68) END Terminate editing mode and return to monitor. EXIT Same as END. TERMINATE COMMAND  EXIT Exit from STATPK. END Exit from STATPK. QUIT Exit from STATPK The numbers in parentheses (..) in the above commands refer to the numbers of the relevant notes which are attached below.Back to Top
Default values
Data File : None Data set number : None Independent Variable (X) : 1 Dependent Variable (Y) : 2 Histogram Variable number (HV) : 1 Order of Regression : None Output Device (OD) : Terminal, Graphics Graphics Terminal (GT) : NG (room 83), OG (room 81) Data input from (DA) : File XN,XM,YN,YM (scale limits) : Auto Transform X,Y (TR) : No X, Yaxes : Linear Titles : No Line weights : Axes : 3 Histogram : 2 (NB<61), 1 (NB>60) Titles : 2 Messages : 2 Labels : 2 Symbols : 1 Plotted Lines : 2 Std Dev bars : 1 Size : Xaxis : 6. (7. for histograms) Yaxis : 5. Titles : .12 Labels : .12 Messages : .12 Symbols : .08 Suppress Grid : No Date and Time : Yes Points left out (LO) : None No. of Grids along X,Y (GX,GY) : 5 Number of Bins : 50 Histograms : Unshaded Line with scatter plot (LP) : No Digits after decimal point (DX,DY) : 2 Averaged Line : No Separate Fit (SF) : No Reverse plot/message positions (RV) : No Message with plot : None Std. deviation bars : No Xorigin (XO) : 7.0 Yorigin (YO) : 1.5 Dashed line factor : 0 Bell with data entry : Yes Histograms : Unshaded Averaged line : Unsmoothed
Notes
(1) All commands are uniquely determined by the first two letters of each command word. For example, the following commands are equivalent :
OU HI OUT HIST OUTPUT HISTOGRAMPLOT
(2) Either commas or spaces can act as delimiters between command words or between values of parameters.
(4) Each data set can have upto 28 variables (columns). Any of these variables may be specified to be the Independent Variable or the Dependent Variable (by IV or DV commands). If the IV and DV commands are not given, either the values last specified are used or, if no values were specified, the default values are used.
(5) All data files are unblocked files of type 1.
(6) When entering data into a data file, missing data points can be specified by setting them equal to 999999.
(7) Note that when using commands in the edit mode, any changes made to the data file are permanent. In particular, the DE and DP commands result in permanent deletions. Use the CL FI command with caution.
(8) Up to 28 data sets can fit into one data file. Each data set within a data file is identified by a unique data set number (1 to 28). Data sets are also characterized by a 12 character alphanumeric ID.
(9) Missing points in a data set are denoted by the letters MP when the data set is listed on any output device by the LP command.
(10) The LO command is automatically canceled after the first analysis performed following the LO command. For example, the sequence : LO 3,1,7 XX LO OU RE OU RE results in points 1,3 and 7 being excluded from the first regression. All points are included in the second regression.
(11) The LO command does not result in any permanent deletions.
(12) The commands IC and SL have the effect of canceling each other out. Only the one last given is accepted by the regression program. Thus, the sequence : IC # SL # OU RF results in a "fixed slope" fit, while : SL # IC # OU RF results in a "fixed intercept" fit.
(14) The variable specified as the independent variable (by the IV command) is used by the OU HI command for histogram plots.
(15) The present restriction on the data sizes which can be analyzed is as follows :
Analysis Max. no. points   OU RE 10000 (lst order reg. only) OU RF 200 OU HI 65536 OU SP 524288
(16) Note that the NB and BW commands may contradict each other, in which case the one given later is used. (17) When using the axes scale commands XN,XM,YN,YM,ZN,ZM the Override (OV) option can be used to exclude any points which do not fall within the specified limits. If the override option is not used and if there are points outside the specified range, then autoscaling is used. (18) With first order regression only it is now possible to get several data sets fitted on the same plot page with a separate fitted line for each. This can be done by using the "SF YES" command before the OU RE command is given. Also note that the OR 1 command must be given before the OU RE command to use this option. (19) It is possible to draw an averaged line through a scatter plot generated with the OU SP command. To get the averaged line, the command AL YES must be used before the OU SP command. The averaged line is computed by dividing the entire Xrange into equal sized windows. The average of all the Yvalues of the points within a certain window is used as the Ycoordinate for the averaged line. The number of windows can be varied with the NB command. (20) Command words enclosed within brackets [...] are optional. (21) The Garbage Collection command (GC), may renumber the data sets. A message is displayed on the user terminal showing the old and new numbers of any affected data sets. (22) In the DP command, a block of points may be deleted by "DP #1 TO #2 #3", or a single point may be deleted by "DP #1 #3". Note that "point" here refers to a row of the data set.
(23) The maximum number of data sets that a STATPK file can hold is determined at the time that the file is created. By default, i.e. if you use the "CR @@@@" command to create the file without specifying a max. number, the new STATPK file is created to hold a max. of 639 data sets. Thus, "CR myfile.dat" is the same as "CR myfile.dat 639".
If you have reason to believe that a file may need to hold more than 639 data sets eventually, then be sure to use the command "CR myfile.dat ##" to create it, where ## is the max. number of datasets.
(24) The default setting for the graphics device is NG (New Graphics). Old Graphics refers to the graphics device in room 81. (25) If multiple column numbers are specified as dependent variables by the DV command, then only one data set can be included with the DS command. (26) When npoint smoothing is done with the SM command, the value of n must be any one of : 3,5,7,9....... 31. (27) If standard deviation bars are to be displayed with the SD YES command, then if the column no. for the dependent (Y) variable is N, then column N+l is assumed to contain the corresponding standard deviations. (28) If a histogram is plotted directly from bin contents with the "OU HI BC" command, then the data set is assumed to contain the bin contents, except the first word (of that column) should contain the bin width, and the second word should contain Xminimum. (29) It is possible to plot a histogram and a scatter plot on the same axes with the "OU SH" command. To use this feature, the scatter plot data should be specified as usual with the "DS...","IV..." and "DV. . . " commands. The histogram data should be specified by the "DH . . . " and "HV. . . " commands. Note that "OU SH" only works with histogram data which already contains the bin contents (i.e. which can be directly binned with the "OU HI BC" command).
(30) The "LW. . . " command can be used to "suppress" parts of a plot by specifying a zero (0) line weight. For example, "LW TX 0" will suppress the top axis.
(31) The "SR YES" and "SR NO" commands have been eliminated. The same functions can be performed by setting the line weights to zero with the "LW LI O " command. (32) The output device can be directly specified in output commands by replacing the "OU" by any one of : GR,PL,PR or DI. The device last used remains in effect for subsequent commands. For example, in the following sequence : OD PL OU RE GR RE OU RE PL RE the first and fourth regression plots will be on the plotter, and the second and third will be on the graphics. (33) Upto 10 symbols can be specified by the user with the SY command. These are used with scatter plots and regression plots. The symbols are specified as integer numbers between 1 and 10. The symbolnumber convention is as described in the GRAPHPAC documentation. The same symbol may be specified more than once. (34) The commands SS,CH,XS,YS have been eliminated. The same functions can now be performed with the "SZ @~ #" command. (35) Upto 28 line weights can be specified with the "LW LI #....#" command. These are used for the regression lines, or the lines joining points in a scatter plot. The value of any line weight can be between O and 5, where O causes the line to be suppressed. The line weight convention is as described in the PLTVAX documentation. (36) Upto 28 dashed line factors can be specified with the DL command. These are used for regression lines, or the lines joining points in a scatter plot. Any dashed line factor can have a value between n and 7, where O causes a solid line to be drawn. The dashed line factor convention is as described in the GRAPHPAC documentation. This command may not work well with 2nd and higher order regressions or when the Xaxis has a log scale. (37) The X or Y or Zaxis scale can be fixed by using the FX option with the XN, XM, YN, YM, ZN or ZM commands. The main difference between the FX and OV options is that with OV any points outside the range are discarded, while with FX points outside the specified range are still plotted. (38) The SV and RT commands make it possible to exit STATPK without losing all the parameter values specified. The typical sequence may be : SV # EXIT and later, to resume at the point where the exit was done, $ STATPK RT # where # is any integer between 0 and 10. If # is missing then it is the same as 0. (39) The main use of the "RT" command is to guard against loss of information if the user inadvertantly exits STATPK without issuing a SV command. The most recent parameter values are automatically saved on disc by STATPK and may be retrieved if STATPK is immediately restarted and the "RT" command given. Note that the "SV" command is invalid. (40) The "ST HI" eommand will store any histogram which would normally be displayed with the "OU HI " eommand baek in the data file. The actual bin eontents are stored , along with the two word header which makes it possible for the stored histogram to be in turn displayed by the "OU HI BC" eommand (see note no. 28 above). The user must precede the "ST HI" command with the same specify commands that would normally be used before an "OU HI" eommand. (41) The "ST AL" command will store the computed averaged line which would normally be displayed with the "OU SP" command back in the user's data file. The "ST AL" command must be preceded by the same specify commands which would normally be used if the averaged line were to be graphed with the "OU SP" command. The newly created data set will have three columns, the first column will be the Xvariable values, the second will be the averaged line, and the third will be standard deviation values, stored in a format compatible with the "SD YES" command.
(42) If #1 and #2 are specified then only dataset numbers in that range are listed.
(43) A new data set will be formed containing the differentiation results as an additional column. The value of #4 must be odd. (44) The option to specify multiple independent variables is most useful with the "OU HI" or "OU DS" commands. If multiple columns are specified by this command then only a single data set can be specified with the "DS. . . " cornmand. (45) The NX DS command properly skips over missing data sets. For example if the current data set number is 7, and data set 8 is missing, then NX DS will jump to data set number 9.
(46) If the value is not found, then the control can [optionally] be transferred to record number # in the macro.
(47) The * can used to include comments in macros by preceding any line with an asterisk (*).
(48) @@@@@@ can be any one of :
DS Current data set number IV Current independent variable number DV Current dependent variable number NROWS Number of rows (points) in current data set NCOLS Number of columns in current data set FNAME Current data file name (character string) DSID Current data set ID (character string) NAVDS Next available dataset number SUMC #1 #2 Sum of column #1 in dataset #2 (*) AVGC #1 #2 Average of column #1 in dataset #2 (*) SDVC #1 #2 Standard Dev. of col. #1 in dataset #2 (*) SDMC #1 #2 Std. Dev.(N1 method) of col. #1 in dataset #2 (*) SERC #1 #2 Std. Error of Col. #1 in dataset #2 (*) MEDC #1 #2 Median of values in Col. #1 in dataset #2 (*) MINC #1 #2 Minimum value in Col. #1 in dataset #2 (*) MAXC #1 #2 Maximum value in Col. #1 in dataset #2 (*) NUMP #1 #2 Number of "nonmissing" points in col #1 of ds #2 (*) NUMSEL Number of points selected by most recent SEL command. B0 Intercept from most recent line fit with "OU RE" B1 Slope for most recent fitted line with "OU RE" RSQ Correlation Coeff. (squared) from most recent "OU RE" MSG #1 Message stored with dataset #1 (char string) CHEAD #1 #2 Column heading for col. #1 in dataset # 2 (char string) SYNCA A# [#1 #2] Sync. coeff. for histogram in A#. #1 and #2 are start and end bin #s
The value is available in V# (or C# if a char. variable).
(*) The asterisk after certain variables means that those computations are for points marked "selected" only.
(49) A space may be substituted for the = sign. (50) @@@@2 can be any valid STATPK command. For example : IF EQ 10 PL SP IF NE 4 GO 17
(51) The interpretation of #3 is as follows :
1 No transformation 2 x'=A.x+B 3 x'=A.log(x) 4 x'=A.ln(x) 5 x'=A.(x**B) 6 x'=A**(B.x) 7 x'=abs(x) 8 x'=(x/A)+B 9 Normalize to 100 10 Multiply by Window 11 Cumulate (unwrap) phase 12 x'=int(x) 13 x'=A.exp(B.x) 14 Halfwave rectify (x'=0 if x<0, else x'=x) 15 Rotate by "A" number of points 16 Compute Intervals
#4 corresponds to A and #5 corresponds to B.
Only points marked "selected" are transformed for a particular column. However for transformation # 15 (rotation), and for # 16 (intervals), all points in a column are included in the rotation, regardless of whether they are marked "selected" or not.
For rotations (transformation #15), if the parameter "A" is positive, then the points are rotated "right" by "A" points. If "A" is negative, the the points are rotated "left" by ABS(A) points.
(52) The "HI SH #" command is used to specify a shading pattern for histograms. The shading pattern is an integer number between 0 and 71. A pattern # of 0 means "no shading", and this can be specified as "HI SH 0" or "HI UN SH". By default histograms are unshaded. A pattern # of 1 means solid (black) histograms. This is specified as "HI SH 1" or "HI SH".
Shading patterns of 2 and greater result in different levels of graylevel shading and crosshatching. It is not possible to describe them all here, but a sample of all available shading pattern codes can be seen by clicking here.
(53) The "SET YX @@@" command is used to specify whether the Left or Right axis should be used for the Yvar for Scatter Plots. For example:
SET YX RIGHT PL SP SET YX LEFT PL SP SET YX DEF PL SP
The first plot will have the Yvar along the right axis, while the next two will have the Yvar along the xaxis. At present the DEF is same as LEFT.
(54) The "SO ...." command can be used to save values of temporary variables in an ascii text file. Thus:
SO "...." C# "...." V# "...." V# .....where "...." is any arbitrary text string, and C# and V# are any character or real variables. The name of the spool (ascii) file must be specified first with an "SPF..." command.
(58) Colors are specified as numeric integers, e.g. 1,2,3 etc. The color corresponding to each code varies depending on the device used. Some commonly used color codes are as follows:
Color Code Xwindow HP Pen Plotter    0 Background(white) Black 1 Foreground(black) Red 2 Red Green 3 Light Green Orange 4 Blue Purple 5 Sky Blue Brown 6 Mauve Blue 7 Yellow Black 8 Black n/a 9 Dark Blue n/a 10 Green n/a 11 Turquoise n/a 13 Brown n/a 14 Purple n/a 15 Grey n/a 16 Navy Blue Thick Black
Additional colors are available on the xwindow color displays and on other color plotters.
(59) The "XC @@@@@@" command can be used to spawn VMS (DCL) commands from within STATPK. For example:
XC DIR XC EVE MYFILE.MCO XC SHOW USERS XC RENAME FILE1.DAT FILE2.DAT
Command is returned back to STATPK when the DCL command is completed.
(60) The " GV A# COL ..." command is used in the contents of any column in a dataset into an array (e.g. A1, A2 etc.) which can then be maniplulated in memory using STATPK commands.
This command will fetch only those points marked "selected".
(61) The "FILT #1 #2 #3 #4..." command is used to filter a waveform using a specified filter type (#2). #1 is the dataset number, #2 is the filter type, and #3 onwards are filter parameters whose interpretation depends on the value of #2.
Currently, the only filter types available are #2 = 1,2 or 3. Filter Type 1 specifies a low pass filter in the frequency domain, with a corner freq. at #3 Hz, and a slope of #4 dB/octave. Filter Type 2 specifies a high pass filter in the frequency domain, with a corner freq. at #3 Hz, and a slope of #4 dB/octave. Filter Type 3 specifies a band pass filter in the frequency domain, with a lowcorner freq. at #3 Hz, a highcorner freq. at #4 Hz, a lowfilter slope of #5 dB/octave, and a highfilter slope of #6 dB/octave. For filter types 1 thru 3, the waveform (in dataset #1) must be in freq. domain (similar to that created by the FFT command). There must be three columns, the first holding freq. in Hz, the second, amplitude in dB, and the third, phase in radians. The number of points must be a power of two (plus one, for the DC term).
In each case, the resulting filtered waveform is stored back in the same file as a new dataset in time domain, with the first column being time in millisecs, and the second being amplitude.
(62) The FFT command is used to compute the Fast Fourier Transform for any column of any dataset. The results as stored as a new dataset in the same file. The parameters are as follows:
#1 Column number containing amplitude #2 Data set number #3 Col. number containing time (or zero) #4 Time Interval between sampled in seconds if #3=0 OR, multiplier to convert time col. to seconds if #3 .NE. 0 #5 if =1 then resultant amplitude units to be linear, else dB.
The resultant data set will have three columns, the first being Frequency in Hz, the second being amplitude in RMS units, and the third being Phase in radians. The DC term will stored as the first point with FREQ=0.
If #4 is omitted then it is assumed to be 1.0 If #5 is omitted then Amplitude will be in dB.
If the number of points in the data set is not an exact power of two then STATPK will expand the amplitude column to the next highest power of two by linear interpolation before doing the FFT.
All internal computations for this command are done in double precision, though the result is converted back to single precision before storage as a new dataset.
The FFT and IFFT commands only work on data points marked "selected".
(63) The IFFT command is used to compute the Inverse Fast Fourier Transform for any column of any dataset. The results as stored as a new dataset in the same file. The parameters are as follows:
#1 Column no. containing amplitude #2 Data set number #3 Column no. containing frequency (or zero) #4 Frequency resolution in Hz if #3 .EQ. 0 OR, multiplier to convert freq column to Hz if #3 .NE. 0 #5 if = 1 then amplitude units are Linear, else dB
It is assumed that the phase (in radians) is stored in column number (#1+1). If the first point has freq=0 then it is used as the DC term, else the DC term is assumed to be zero. If #3=0 then also the DC term is assumed to be zero.
The resultant data set will have two columns, the first being Time in seconds and the second being amplitude.
If #4 is omitted then it is assumed to be 1.0 If #5 is omitted then Amplitude assumed to be in dB.
The number of points must be an exact power of 2 excluding any DC term.
All internal computations for this command are done in double precision, though the result is converted back to single precision before storage as a new dataset.
The FFT and IFFT commands only work on data points marked "selected".
(64) The "NUM PBS #" command is used to specify how many symbols should be skipped when drawing a scatter plot. "NUM PBS DEF" is same as "NUM PBS 1", i.e. a symbol is shown with every point. "NUM PBS 10", e.g. would result in the symbol being drawn for every 10'th point only in the next "OU SP" plot. This option is useful when there are a large number of points in a dataset, and the symbols get too crowded on a plot.
(65) The command "AUTO" sets autoscaling for all axes. It is also possible to autoscale each axis limit individually, by using the following commands:
XN DEF (autoscale Xmin) XM DEF (autoscale Xmax) YN DEF (autoscale Ymin) YM DEF (autoscale Ymax) ZN DEF (autoscale Zmin) ZM DEF (autoscale Zmax)
(66) Any command line where the first nonblank character is an asterisk (*) or a double slash (//) is treated as a comment and ignored by STATPK. This feature may be used to include comments in macros.
The asterisk (*) as a comment is provided mainly for backwards compatibilty with older macros, and the double slash (//) should be used instead wherever possible. The double slash (//) may also be inserted on the same line as an RAP command, and used to add a comment on the same line as the command. Anything following a double slash (//) will be ignored.
The following are examples of valid comments:
* This is a comment // This is also a comment DF R8814 // this part is the comment NB 100 // set number of bins etc.
The following is INVALID.
NB 100 * This is NOT a valid comment
(67) The "ACA #1 #2 [#3]" command computes the autocorrelation of any time domain waveform. #1 is the column number containing amplitudes, #2 is the data set number, and #3 is an optional parameter that specifies the time interval between successive amplitude values in millisecs. If #3 is omitted, then the program assumes a 1 millisec sampling interval.
The results are stored back as a new dataset in the same file, with two columns, time and amplitude. The range of timeshift should be specified using the "XN..." and "XM..." commands.
(68) The "ACS #1 #2 [#3]" command computes the autocorrelation of any column containing spike time data. #1 is the column number and #2 is the dataset number containing the spike times. By default it is assumed that spike times are in units of milliseconds. If they are not, then the optional parameter #3 should specify the multiplier to convert times to millisecs. For example, if the spike times are stored in seconds, then #3 should be set equal to 1000. If the spike times are stored in millisecs, the #3 should be omitted.
The autocorrelation is computed and stored back in the same file as a new dataset, in the form of a "binned histogram", i.e. the first word is the binwidth, and the second word is the Xmin. Word 3 onwards is the binned histogram.
The "OU HI BC" command can be used to view the results.
The results are directly impacted by the "XN ..", "XM ..." and "NB ..." commands. At present, if NB=50, then the program sets the binwidth to 1 millisec, and adjusts the number of bins according to XN and XM.
(69) The "IN ...." command is used to read an array of numbers from an ascii file into a STATPK data file. The array is stored as a new STATPK data set. Typically, the ascii file should contain a table (or array) of numeric values in one or more columns, separated by spaces, commas, or tabs. Nonnumeric (i.e. alphabetic) data values will be stored as "missing points".
It is possible to read in a message line if it is the first line in the ascii file, and the command is modified as follows:
IN MSG @@@@@
It is also possible to read alphanumeric column headings if the command is modified as follows:
IN HEAD @@@@@
If the first line in the ascii file is a message, and the second contains column headings, then use the following:
IN MSG HEAD @@@@@
However, "IN HEAD MSG @@@@@" is not a valid command.
Acknowledgements
This work was done under the direction of Dr. W.S. Rhode. It also benefited from the comments of the many users of the Neurophysiology Auditory Laboratory.
Support provided in part by a Grant from NIH.
If you have questions about, or suggestions for, this document, please send email to kochhar@physiology.wisc.edu
Return to Documentation Page
Back to The Basement
This page last modified on : July 28, 2005