University of Minnesota
School of Statistics

Each Link is to Acrobat PDF file containing a chapter or appendix of the Users' Guide (Chapter 2 is in two files).

MacAnova 4.07 Users' Guide

Table of Contents

(mancntnt.pdf)
Preface (manpref.pdf)
i
1. Introduction (manchp01.pdf)
  1.1 What is MacAnova? 1-1
  1.2 Comments on Version 4.07 1-2
  1.3 Conventions in this manual 1-4
  1.4 Disclaimer 1-4
  1.5 Acknowledgments 1-4
  1.6 How to contact the authors 1-6

2. The Basics (manchp2a.pdf)
  2.1 Getting Started 2-1
  2.2 Quitting 2-1
  2.3 Functions and macros 2-2
  2.4 Variables 2-3
  2.5 Data types ­ REAL, LOGICAL and CHARACTER 2-3
  2.6 Shapes of variables ­ scalars, vectors, matrices, arrays 2-4
  2.7 Missing values 2-5
  2.8 Introduction to MacAnova syntax 2-5
    2.8.1 Spaces and comments 2-6
    2.8.2 Keywords 2-6
    2.8.3 Arithmetic expressions 2-6
    2.8.4 Comparison operators and logical operators 2-7
    2.8.5 Bit-wise operations on integers 2-8
    2.8.6 Mathematical functions and transformations 2-10
    2.8.7 Assignment of values to variables 2-12
    2.8.8 Arithmetic assignment operators 2-13
    2.8.9 print(), write(), list(), listbrief() and delete() 2-13
    2.8.10 Vectors ­ vector(), enter and enterchars 2-15
    2.8.11 Using subscripts with vectors 2-16
    2.8.12 rep() and run() 2-18
    2.8.13 Matrices and matrix() 2-19
    2.8.14 Using subscripts with matrices 2-20
    2.8.15 Arrays ­ array() 2-21
    2.8.16 Structures ­ structure() 2-23
    2.8.17 Matrix subscripts 2-25
  2.9 Getting help ­ help() and usage() 2-26
    2.9.1 Using the help() wild card characters ­ "*" and "?" 2-27
    2.9.2 Using help() index keys 2-27
    2.9.3 Getting help on macros ­ macrousage() 2-28
  2.10 Operations with vectors, matrices, and arrays 2-28
    2.10.1 Transformations 2-28
    2.10.2 Arithmetic with vectors, matrices and arrays 2-29
    2.10.3 Matrix transposition 2-30
    2.10.4 Matrix multiplication 2-31
    2.10.5 Matrix inversion and linear equation solving 2-32
    2.10.6 Other matrix functions ­ det(), trace(), hconcat(), vconcat(), diag(), dmat(), nrows(), ncols(), select(), reverse() 2-33
  2.11 Reading data from a file 2-35
    2.11.1 vecread() 2-36
    2.11.2 (manchp2b.pdf) readcols 2-38
    2.11.3 matread() and read() 2-39
    2.11.4 getdata 2-41
    2.11.5 inforead() 2-41
    2.11.6 HOME, DATAPATHS and adddatapath 2-42
  2.12 Simple statistics 2-43
    2.12.1 describe() 2-43
    2.12.2 boxplot(), vboxplot, stemleaf() and hist 2-46
    2.12.3 sort(), rank(), rankits(), halfnorm(), and grade() 2-51
    2.12.4 sum(), prod(), max(), min() 2-54
    2.12.5 Computing correlations ­ cor() 2-55
    2.12.6 Student's t related functions ­ tval(), t2val(), tint(), t2int() and twotailt 2-56
    2.12.7 P-values and cumulative distributions functions ­cumxxx() functions 2-58
    2.12.8 Probability points and inverse cumulatives ­invxxx() functions 2-62
    2.12.9 Grouping data in class intervals ­ bin() 2-63
  2.13 Random numbers ­ runi(), rnorm(), rbin() and rpoi() 2-65
    2.13.1 Random number "seeding" ­ setseeds() and getseeds() 2-66
    2.13.2 Generating other random variables 2-66
  2.14 More on rep() and run() 2-67
  2.15 Making graphs 2-68
    2.15.1 plot() 2-69
    2.15.2 lineplot() 2-70
    2.15.3 chplot() 2-71
    2.15.4 Equally spaced x values 2-73
    2.15.5 Graphics keywords 2-73
    2.15.6 colplot and rowplot 2-73
    2.15.7 Low resolution plots 2-74
  2.16 Using spool() to save output 2-74
  2.17 Using save() and restore() to preserve work between sessions 2-76

3. Linear Models (manchp03.pdf)
  3.1 Introduction to GLM commands 3-1
  3.2 Response and independent variables in linear models 3-2
  3.3 Variates and factors ­ factor() and makefactor 3-3
  3.4 Specifying a model 3-4
    3.4.1 Transforming "on-the-fly" 3-6
    3.4.2 Model shortcuts: *, ^, /, ­ and ­* 3-7
    3.4.3 Shortcuts for polynomial and periodic regressions 3-8
  3.5 Error terms 3-8
  3.6 Side effect variables 3-9
  3.7 GLM keywords 3-9
  3.8 anova() and regress() output 3-11
  3.9 Balanced and unbalanced data 3-15
  3.10 Parametrization and degrees of freedom 3-16
  3.11 Marginal (Type III) sums of squares 3-18
  3.12 Cell by cell statistics using tabs() and cellstats() 3-19
  3.13 Estimated ANOVA effects and their standard errors ­ coefs() and secoefs() 3-20
    3.13.1 Estimated regression coefficients and their standard errors ­ regcoefs 3-22
  3.14 Leaving out lower order terms 3-23
  3.15 Empty cells 3-24
  3.16 Estimating contrasts ­ contrast() 3-27
    3.16.1 Contrasts for each level of a factor 3-31
  3.17 Residuals ­ resid, resvsyhat, resvsrankits, resvsindex 3-32
  3.18 Predicted values ­ regpred(), yhat, predtable(), glmpred() and glmtable() 3-35
  3.19 Faster ANOVA calculation ­ fastanova() 3-38
  3.20 Selection of a subset of X-variables ­ screen() 3-39
  3.21 Power and sample size ­ power(), power2() and samplesize() 3-42
  3.22 Multivariate linear models ­ manova() 3-45
  3.23 Weighted analyses ­ keyword weights and side effect variable WTDRESIDUALS 3-48
  3.24 Retrieving information about a GLM analysis 3-49
    3.24.1 modelvars() and varnames() 3-49
    3.24.2 xvariables() 3-50
    3.24.3 xrows() 3-51
    3.24.4 modelinfo() 3-52
    3.24.5 Decoding modelinfo(bitmodel:T) 3-55

4. Generalized linear models and robustness (manchp04.pdf)
  4.1 Alternatives to Least Squares 4-1
  4.2 Generalized Linear Model Commands 4-1
    4.2.1 Analysis of Deviance Table 4-2
    4.2.2 Side effect variables 4-3
    4.2.3 Keywords 4-4
    4.2.4 logistic() and probit() 4-5
    4.2.5 poisson() and ipf() 4-7
    4.2.6 glmfit() 4-7
  4.3 Robust regression ­ robust() 4-8

5. Time Series related functions (manchp05.pdf)
  5.1 Introduction 5-1
  5.2 Functions useful in frequency domain time series analysis 5-1
    5.2.1 The DFT (Discrete Fourier Transform) 5-1
    5.2.2 Continuous Fourier transform of a finite series 5-3
    5.2.3 Representation of Real, Hermitian, and Complex Series 5-3
    5.2.4 Functions for manipulating Complex and Hermitian series ­ hconj(), cconj(), hreal(), creal(), himag(), cimag(), cpolar(), hpolar(), crect(), hrect(), htoc(), ctoh(), cmplx() 5-5
    5.2.5 padto() and rotate() 5-9
    5.2.6 Elementwise products of Complex and Hermitian series ­ hprdh(), hprdhj(), cprdc(), cprdcj() 5-10
    5.2.7 Discrete Fourier Transforms ­ rft(), hft() and cft() 5-10
    5.2.8 Convolving series using the DFT and function convolve() 5-12
  5.3 Functions related to time domain time series analysis 5-14
    5.3.1 Moving average and autoregressive operators 5-14
    5.3.2 movavg() 5-16
    5.3.3 autoreg() 5-17
    5.3.4 yulewalker() and partacf() 5-18
    5.3.5 toeplitz() 5-19
    5.3.6 Finding zeros of polynomials ­ polyroot() 5-20
  5.4 Macros useful in time series analysis 5-21
    5.4.1 Plotting against time ­ tsplot 5-22
    5.4.2 Plotting against frequency ­ ffplot 5-23
    5.4.3 Computing auto-covariances ­ autocov 5-26
    5.4.4 Removing a polynomial trend ­ detrend 5-27
    5.4.5 Using tapers (data windows) ­ costaper and compza 5-27
    5.4.6 Smoothing periodograms ­ compfa and spectrum 5-30
    5.4.7 Smoothing cross-periodograms ­ compfa and crsspectrum 5-34
5.4.8 Multi-taper spectrum estimation ­ multitaper 5-36
    5.4.9 Autoregressive spectrum estimation ­ arspectrum and burg 5-37

6. Other functions (manchp06.pdf)
  6.1 Linear model computations using swp() 6-1
    6.1.2 Computing a more accurate cross product matrix ­ bcprd() 6-4
  6.2 Computation of eigenvalues and eigenvectors 6-5
    6.2.1 Ordinary eigenvalues and eigenvectors ­ eigenvals() and eigenvectors() 6-5
    6.2.2 Eigenvalues and eigenvectors of a tridiagonal matrix ­ trideigen() 6-7
    6.2.3 Relative eigenvectors and eigenvalues of a symmetric matrix ­ releigenvals() and releigen() 6-8
  6.3 Singular value decomposition ­ svd() 6-10
  6.4 QR decomposition ­ qr() 6-11
  6.5 Cholesky decomposition ­ cholesky() 6-13
  6.6 Working with triangular matrices ­ triupper(), trilower() and triunpack() 6-13
  6.7 Cluster analysis 6-15
    6.7.1 Hierarchical analysis ­ cluster() 6-15
    6.7.2 K-means analysis ­ kmeans() 6-19
  6.8 Factor rotation ­ rotation() 6-22

7. Files (manchp07.pdf)
  7.1 Format of data readable by matread() and read() 7-1
    7.1.1 REAL and LOGICAL data 7-5
    7.1.2 CHARACTER data 7-6
    7.1.3 Structures 7-6
    7.1.4 Labels and notes 7-7
    7.1.5 matread() and read() keywords 7-8
  7.2 Reading CHARACTER data from files 7-8
  7.3 "Reading" from CHARACTER variables 7-11
    7.3.1 "Decoding" a CHARACTER variable 7-12
    7.3.2 Finding ASCII codes for a CHARACTER variable ­ getascii() 7-12
  7.4 Writing data to the screen and to files 7-14
    7.4.1 print() and write() 7-15
    7.4.2 matprint() and matwrite() 7-17
    7.4.3 putascii() 7-20
  7.5 Macro files 7-21
    7.5.1 macroread() and the format of macro files 7-21
    7.5.2 macrowrite() 7-23
    7.5.3 getmacros 7-24
    7.5.4 addmacrofile 7-25
  7.6 Executing commands in a file ­ batch() 7-25
  7.7 Additional options on save( and restore() 7-27
  7.8 Customizing MacAnova 7-29
    7.8.1 Using a start up file 7-29
    7.8.2 Environmental variable MACANOVA 7-30

8. Advanced Features (manchp08.pdf)
  8.1 MacAnova options 8-1
    8.1.1 getoptions() 8-1
    8.1.2 setoptions() 8-2
    8.1.3 List of available options 8-3
  8.2 Treatment of errors 8-7
  8.3 Creating CHARACTER variables 8-8
    8.3.1 Building custom CHARACTER variables ­ paste() 8-9
    8.3.2 Formatting paste() output 8-9
    8.3.3 Creating CHARACTER vectors using paste() 8-11
    8.3.4 Creating CHARACTER variables using putascii() 8-11
  8.4 Coordinate labels 8-12
    8.4.1 Adding labels to a variable ­ setlabels() 8-12
    8.4.2 Retrieving labels from a variable ­ getlabels() and haslabels 8-16
    8.4.3 Transforming labels 8-17
    8.4.4 Propagation of labels 8-18
  8.5 More on plotting 8-20
    8.5.1 Keywords affecting appearance and bounds 8-20
    8.5.2 Other graphics keywords 8-21
    8.5.3 Replotting graphs and GRAPH variables 8-23
    8.5.4 Writing graphs to a file 8-25
  8.6 More on help() and usage() 8-26
    8.6.1 Using more than one help file 8-26
    8.6.2 Finding what's new 8-27
  8.7 Running other programs from within MacAnova 8-28
    8.7.1 shell() 8-28
    8.7.2 shell() keyword phrases interact:T and keep:T 8-29
    8.7.3 Lines starting with "!" 8-29
  8.8 Recalling previous commands 8-30
    8.8.1 Macros redo and REDO 8-30
    8.8.2 Keyboard and menu recall 8-30
    8.8.3 gethistory() and sethistory() 8-31
  8.9 "Notes" attached to variables 8-32
    8.9.1 attachnotes(), appendnotes(), getnotes() and hasnotes 8-33

9. Programming MacAnova (manchp09.pdf)
  9.1 Working with structures 9-1
    9.1.1 Creating structures ­ structure(), strconcat() and split() 9-1
    9.1.2 Getting information about a structure ­ ncomps() and compnames() 9-5
    9.1.3 Changing a structure ­ changestr() 9-5
  9.2 Compound commands, conditional commands, and looping commands 9-6
    9.2.1 Compound commands 9-6
    9.2.2 Conditional commands ­ if, elseif and else 9-7
    9.2.3 Looping ­ for and while 9-9
    9.2.4 Escaping from loops ­ break and breakall 9-11
    9.2.5 Skipping to the end of a loop 9-12
  9.3 Macros 9-13
    9.3.1 Creating macros 9-14
    9.3.2 Argument substitution 9-14
    9.3.3 The use of temporary variables and $$ 9-16
    9.3.4 Other expanding macro symbols 9-18
    9.3.5 In-line and out-of line macros 9-19
    9.3.6 Using delete(result,return:T) in a macro 9-20
  9.4 Functions useful in macros 9-21
    9.4.1 Functions unique() and match() 9-21
    9.4.2 Checking the characteristics of variables ­ isxxxx() functions 9-22
    9.43 Other miscellaneous functions ­ anymissing(), nameof(), error() and gettime() 9-24
    9.4.4 Keywords in macros ­ using $k and $K 9-25
    9.4.5 Checking and evaluating keyword phrase arguments ­ keyvalue() 9-27
    9.4.6 Checking and evaluating non-keyword arguments ­ argvalue() 9-28
    9.4.7 Properties checked by keyvalue() and argvalue() 9-29
  9.5 Indirect evaluation of MacAnova commands 9-30
    9.5.1 evaluate() 9-30
    9.5.2 Indirect references using <<...>> 9-30
  9.6 Analysis of macro regs 9-31
  9.7 User functions 9-33
    9.7.1 loadUser() 9-33
    9.7.2 User() 9-33
    9.7.3 User function arguments and returned values 9-34
    9.7.4 Passing integer arguments ­ aslong() 9-36

10. Examples of Linear Model Analyses (manchp10.pdf)
  10.1 Introduction 10-1
  10.2 Simple descriptive statistics 10-1
  10.3 Simple linear regression 10-3
  10.4 Multiple linear regression 10-5
  10.5 One way ANOVA 10-6
  10.6 Polynomial regression 10-8
  10.7 Variance stabilizing transformations 10-9
  10.8 Randomized complete block 10-13
    10.8.1 Multiple comparisons 10-14
    10.8.2 Randomized block with data missing 10-17
  10.9 Latin squares 10-18
  10.10 Balanced incomplete blocks 10-18
  10.11 Analysis of covariance 10-19
  10.12 Factorial models 10-22
  10.13 Factorial designs with confounding 10-26
  10.14 Fractional factorial designs 10-27
  10.15 Split plot designs 10-29
  10.16 Multivariate analysis of variance 10-30
    10.16.1 Multivariate test statistics 10-33
    10.16.2 MANOVA canonical variables 10-34
  10.17 Repeated measures designs 10-35
  10.18 Logistic regression 10-40
  10.19 Poisson regression 10-41
  10.20 Robust regression 10-42

11. Summary of Usage (manchp11.pdf)
  11.1 Commands, functions and macros 11-1
  11.2 Operators 11-16
    11.2.1 Arithmetic operators 11-16
    11.2.2 Comparison operators 11-16
    11.2.3 Logical operators 11-17
    11.2.4 Matrix operators 11-17
    11.2.5 Bitwise operators 11-17
    11.2.6 Assignment operators 11-18
  11.3 Control syntax elements 11-18
    11.3.1 Syntax elements for conditional execution 11-18
    11.3.2 Syntax elements for looping 11-18
    11.3.3 Syntax elements for leaving a loop 11-19
    11.3.4 Syntax element for skipping to the end of a loop 11-19
  11.4 Some differences from S-Plus 11-19

References (manrefs.pdf) Ref-1

Appendix A Commands and Macros Grouped by Topic (manapdxa.pdf) A-1

Appendix B MacAnova on a Macintosh (manapdxb.pdf)
  B.1 Introduction B-1
    B.1.1 MacAnova windows B-1
    B.1.2 Versions for different types of Macintoshes B-1
    B.1.3 File names B-2
  B.2 Launching MacAnova B-2
  B.3 Menus B-2
    B.3.1 The Apple and Help menus B-3
    B.3.2 The File menu B-3
    B.3.3 The Edit menu B-5
    B.3.4 The Windows menu B-7
    B.3.5 The Command menu B-9
    B.3.6 The Options menu B-11
    B.3.7 The Font menu B-14
  B.4 Graph windows B-15
  B.5 Location of files B-16
  B.6 Other features B-16
    B.6.1 Interrupting MacAnova B-16
    B.6.2 Running other programs while in MacAnova B-16
    B.6.3 Editing Macros B-16
    B.6.4 Using keys to move around the command/output window B-17
    B.6.5 Recalling previous commands B-18
    B.6.6 "Console" input on the Macintosh B-18
  B.7 Non-interactive mode B-19
  B.8 Miscellaneous information B-20
    B.8.1 Compilers B-20
    B.8.2 Distribution of MacAnova for Macintosh B-20

Appendix C DOS versions of MacAnova on an IBM Compatible (manapdxc.pdf)
  C.1 Introduction C-1
    C.1.1 Extended memory version (MACANODJ) C-1
    C.1.2 Limited memory version C-1
  C.2 Launching MacAnova C-2
    C.2.1 Launching MacAnova at the DOS prompt C-2
    C.2.2 Launching MacAnova in Windows and Windows 95 C-2
  C.3 Graphics C-2
    C.3.1 Graphics in the extended memory version C-3
    C.3.2 Graphics in the limited memory version C-3
  C.4 Location of files C-3
  C.5 Other features C-3
    C.5.1 Interrupting MacAnova C-3
    C.5.2 Running other programs while in MacAnova C-4
    C.5.3 Editing Macros C-4
    C.5.4 Editing the current command line C-4
    C.5.5 Recalling and editing previous commands C-4
    C.5.6 "Console" input in DOS MacAnova C-4
  C.6 Command line arguments C-6
    C.6.1 File options C-6
    C.6.2 Path options C-7
    C.6.3 Other options C-7
  C.7 Non-interactive mode C-8
  C.8 Miscellaneous information C-8
    C.8.1 Compilers C-8
    C.8.2 Distribution of DOS versions of MacAnova C-8

Appendix D Windows version of MacAnova on an IBM Compatible (manapdxd.pdf)
  D.1 Introduction D-1
    D.1.1 MacAnova windows D-1
    D.1.1 File names D-2
  D.2 Launching MacAnova D-2
    D.2.1 Launching Windows MacAnova at the DOS prompt D-2
  D.3 Menus D-2
    D.3.1 The File menu D-2
    D.3.2 The Edit menu D-4
    D.3.3 The Windows menu D-5
    D.3.4 The Help menu D-6
  D.4 Graph windows D-6
  D.5 Location of files D-7
  D.6 Other features D-7
    D.6.1 Interrupting MacAnova D-7
    D.6.2 Running other programs while in MacAnova D-7
    D.6.3 Editing Macros D-8
    D.6.4 Using keys to move around the command/output window D-8
    D.6.5 Recalling previous commands D-8
    D.6.6 "Console" input under Windows D-8
  D.7 Command line arguments D-9
  D.8 Non-interactive mode D-9
  D.9 Miscellaneous information D-9
    D.9.1 Compilers D-9
    D.9.2 Distribution of Windows version of MacAnova D-9

Appendix E Unix version of MacAnova (non Motif) (manapdxe.pdf)
  E.1 Introduction E-1
  E.2 Launching MacAnova E-1
  E.3 Graphics E-1
  E.4 Location of files E-2
    E.4.1 Changing the default file locations E-3
  E.5 Other features
    E.5.1 Interrupting MacAnova E-3
    E.5.2 Running other programs while in MacAnova E-3
    E.5.3 Editing Macros E-3
    E.5.4 Editing the current command line E-4
    E.5.5 Recalling and editing previous commands E-4
    E.5.6 "Console" input in Unix MacAnova E-4
    E.5.7 Viewing data and macros E-4
  E.6 Command line arguments E-4
  E.7 Non-interactive mode E-4
  E.8 Miscellaneous information E-4
    E.8.1 Compilers E-4
    E.8.2 Distribution of Unix versions of MacAnova E-4

Appendix F Motif version of MacAnova (manapdxf.pdf)
  F.1 Introduction F-1
  F.2 Launching MacAnova F-1
  F.3 Menus F-1
    F.3.1 The File menu F-1
    F.3.2 The Edit menu F-1
    F.3.3 The Windows menu F-2
    F.3.4 The Help menu F-2
  F.4 Graph windows F-2
  F.5 Location of files F-2
  F.6 Other features F-2
    F.6.1 Interrupting MacAnova F-2
    F.6.2 Running other programs while in MacAnova F-2
    F.6.3 Editing Macros F-2
F.6.4 Using keys to move around the command/output window F-3
    F.6.5 Recalling previous commands F-3
    F.6.6 "Console" input under Windows F-3
    F.6.7 Viewing data and macros F-3
  F.7 Command line arguments F-3
  F.8 Non-interactive mode F-3
  F.9 Miscellaneous information F-3
    F.9.1 Compilers F-3
    F.9.2 Distribution of MacAnova F-3

C. Bingham kb@stat.umn.edu

Last Updated Tue Jan 29 08:57:18 CST 2002