Enhancements to MacAnova 4.00 not in March 1993 Users' Guide This document briefly summarizes all MacAnova features that were not described in the March 1993 MacAnova Users' Guide. A few features were present in version 3.12. Many were present in Version 3.35. Features new to Version 4.00 are indicated by "[4.00]". A few may not have been in the first released version of 4.00. For more information on new items or features, see the related help topics. For example, to learn details about bin(), type 'help(bin)'. New functions bin() computes a group frequency distribution from data and bin boundaries. cholesky() computes the Cholesky decomposition of a positive definite symmetric matrix cumstudrng() and invstudrng() [4.00] compute cdf and quantiles of the distribution of the studentized range getlabels() [4.00] retrieves labels from variables. gettime() [4.00] allows timing of operations. glmfit() [4.00] fits linear and generalized linear (GLM) models, including anova(), logistic(), poisson() and probit() as special cases. glmpred() [4.00] generalizes regpred() to non-regression models. glmtable() [4.00] generalizes predtable(), allowing computation of standard errors. inforead() returns as a CHARACTER variable the comment lines following the header line on a macro or REAL data set on a file. macrousage() and usage() [4.00] provide shorter help on macros and functions. modelinfo() returns information about the most recent GLM model, including the design variables, the dependent variable, the inverse of the X'X matrix, the weights, if any, the coefficients of the design variables and a vector of integers whose binary representations represent the terms in the model. In version 4.00 you can also retrieve the indices of the aliased X-variables and the logistic and probit sample size vector. modelvars() returns some or all of the variables in the current GLM model, including dependent variable, variates and factors. nbits() returns the number of 1 bits in the binary representation of each element of its integer argument. nrows() and ncols() return the number of rows or columns of a matrix. partacf() computes the partial autocorrelation function from an autocorrelation function and vice versa polyroot() finds the roots of polynomials with real coefficients. probit() [4.00] carries out probit analysis rational() allows the easy evaluation of a rational function, given the numerator and denominator coefficients. rename() allows you to change the name of a variable [4.00]. reverse() reverses the order of the rows of a vector or matrix. rotation() computes varimax rotation of a loading matrix. rsolve(a,b) [4.00] solves linear equation x %*% a = b select() [4.00] allows selection of one element from each row of a matrix with a vector of integers specifying which element in each row. strconcat() allows you more easily to add components to a structure or merge two or more structures. structure() [4.00] is a synonym for makestr(). toeplitz() creates a correlation or covariance matrix from an autocorrelation or autocovariance function. trideigen() computes eigenvalues and eigenvectors of a symmetric tri-diagonal matrix varnames() returns the names of the variables in the current model or a specified model vector() [4.00] is a synonym for cat(). xrows() [4.00] computes rows of the design matrix corresponding to the current GLM model. xvariables() computes the design variables of a specified GLM model, or returns the design variables from the current GLM model yulewalker() finds autoregressive coefficients given an autocorrelation function and vice versa. New operators Arithmetic assignment operators <-+, <--, <-*, <-/, <-^ and ^-%%. For example 'y <-* 3' is equivalent to 'y <- 3*y'. Comparison operators ==, !=, <=, >=, < and > apply to LOGICAL data, with True and False interpreted as 1 and 0. Also ? == ? and ? != 2 have value True and ? != ? and ? == 2 have value False. Bit operators %&, %|, %^, and %! allow bitwise computation with integers. Type 'help(bit_ops)' for details. These can be used with the output of modelinfo(bitmodel:T) to examine the structure of the current model. Matrix operators %/% and %\% [4.00] can be used instead of solve() and rsolve(). New features Linear and generalized linear model (GLM) related: The number of distinct variables and factors allowed in a GLM has been increased from 31 to 96, including no more than 31 factors. In a GLM model, a '#' and anything following it are now ignored, thus allowing models to be self documenting, as in anova("y=blk+a*b # two factor randomized block"). Keyword phrase 'coefs:F' on linear model commands except regress() and screen(), suppresses computation of coefficients and standard errors. The denominator argument N for logistic() can be a scalar (single number) instead of a vector. You can use keyword phrase 'n:N' to specify N [4.00]. Keywords 'pvals' and 'fstats' [4.00] allow printing of P-values and, where appropriate, F-statistics Univariate statistics are available on manova() [4.00], controlled by keywords 'fstats', 'pvals', and 'byvar'. Printing of large SS/SP matrices by manova() is no longer the default. It can be controlled by keyword 'sssp'. Keyword phrase 'marginal:T' on anova(), wtanova(), manova(), wtmanova(), and robust() [4.00] causes computation of SAS Type III sums of squares in many cases. robust() now now gives an approximate ANOVA table which can be used, at least asymptotically, for testing linear hypotheses [4.00]. Also the truncation point can be modified using keyword 'trunc' New keywords 'coefs' and 'se' on coefs() and secoefs() allow you to force or suppress computation of coefficients or standard errors. Thus secoefs(coefs:F) computes only standard errors and coefs(se:T) is the same as secoefs(). In addition, byterm:F on secoefs() reorders the structure produced so that secoefs(byterm:F)$coefs and secoefs(byterm:F)$se give you all the coefficients or all the standard errors. You can use term numbers instead of names in coefs(), secoefs() and contrast(). Keyword 'keep' on screen() allows you to save some or all of the results in a variable. Functions modelinfo(), modelvars(), varnames(), xrows() [4.00], xvariables(), probit() [4.00], glmfit() [4.00], glmpred() [4.00], glmtable() [4.00]. predtable() and glmtable() recognize keywords 'x', 'wtdmeans', 'se', and 'n' [4.00]. You can compute marginal tables with standard errors using predtable() and glmtable() [4.00]. Main effect models ("y=a+b+c", for example) with balanced designs are recognized and sums of squares are computed efficiently rather than by Gram-Schmidt orthogonalization of the design matrix. Such designs include Latin Squares and many fractional factorials. There is a new macro file, design.mac, containing macros helpful in the design of experiments. Help is available in file design.hlp. Graph related The graphing commands accept a two component structure as a single argument instead of separate x and y arguments. Thus, for example, plot(structure(x,y)) is equivalent to plot(x,y). New keywords 'pause', 'landscape', 'linetype', 'thickness', 'window' give greater control of plotting. See topic 'graphs'. Keyword phrase 'impulse:T' can be an argument to plot(), lineplot(), chplot(), addlines(), and addchars(). There is a new plotting symbol, the dot, specified by "\7" when using chplot() or addchars(). plot(), chplot(), and lineplot() recognize the keyword phrase add:T, so that, for example, lineplot(x,y,add:T) is equivalent to addlines(x,y). Macro related: If, for example, the first argument to a macro is "foo", the command, '@c <- "$1"' expands to '@c <- "\"foo\"". Previously it expanded to '@c <- ""foo"" which caused an error. Similarly, $A expands correctly, even when arguments are quoted strings. See topic 'macros'. Keyword phrase 'dollars:T' on macro [4.00] ensures all temporary variables end in '$$'. Macro argument place holders $01, $02, ... (instead of $1, $2, ...) are replaced by NULL when the argument is missing [4.00]. Syntax related: Control word 'elseif' allows usages such as if(x < 0){s <- -1;;}elseif(x > 0){s <- 1;;}else{s <- 0;;} or, equivalently, s <- if(x < 0){-1}elseif(x > 0){1}else{0} See topic 'if'. Additional form [4.00], for(index, start, end [,incd]){...}, of for loop. New pre-defined macro breakif(Logical) or breakif(Logical,n) is equivalent to if(Logical){break} or if(Logical){break n}. New variable type NULL [4.00] contains no data. Several functions, including cat(), hconcat, vconcat(), and isreal() can have NULL arguments. Functions that do not return a usable value now return a NULL variable. <> now works with the names of constants [4.00], that is with "T". "F", "NULL", and, for example, "-123.5". For example, <<"3.14">> is REAL with value 3.14. Precedence level of matrix multiplication made higher than '*', '/', and '%%' [4.00]. A vector of subscripts which is all F is allowed [4.00]. A matrix or array subscript can be used with a CHARACTER variable [4.00]. You can use 'T', 'F', 'NULL' and syntax elements such as 'if' and 'break' as keyword names [4.00]. File related: Interactive editing of the current command and recall of previous lines (history) implemented for Unix and protected mode DOS verions [4.00] File names of "~/foo" or "~:foo" are now expanded using the contents of a CHARACTER variable HOME. For example on a Macintosh, if you set HOME to "Hard Disk:Homework Folder", either "~/Assignment 5" or "~:Assignment 5" will be interpreted as "Hard Disk:Homework Folder:Assignment 5". On Unix, HOME is pre-defined to have the value of environmental variable $HOME (usually your home directory); on DOS it is pre-defined to be the name of the directory where MACANOVA.EXE is located. On any platform, HOME can be customized in your copy of the startup file (MacAnova.ini or .macanova.ini). New keywords 'v24' and 'v31' for save() allow you to save files in formats that can be read by older versions of MacAnova. Also save(fileName, ascii:T) is equivalent to asciisave(fileName). In version 4.00, 'v335' allows saving of files to be readable by version 3.35. Files produced by asciisave() now have no non-printable characters. Among other effects, this makes an asciisave file safer to e-mail. restore(fileName,list:T ...) lists information on variables and macros as they are restored. Data input related matread() can now read CHARACTER data [4.00]. Depending on the header of the data set, the items read can be entire lines, space or tab separated fields, and comma separated quoted fields. vecread() can now read CHARACTER data [4.00]. Relevent keyword phrases are 'char:T' (read comma separated fields) and 'bylines:T' (each item read is an entire line). vecread() interprets an isolated period ('.') as MISSING, following a convention used by SAS and other statistical programs. Keyword phrase 'string:CharVar' [4.00] in place of FileName on any command reading data or a macro allows "reading" from CHARACTER variable CharVar. Keyword phrase echo:T on matread(), macroread(), and vecread() causes lines read from the file to be listed. Keywords 'badvalue' and 'silent' on vecread() [4.00] allow silent detection of bad values in a file or string. Keywords 'skip', 'stop' and 'quiet' on vecread() [4.00] allow control of which lines to skip and what character should stop the read. Data output and formatting related matprint() and matwrite() can now write CHARACTER data [4.00]. Keyword 'name' on print(), write(), matprint(), and matwrite() [4.00] allows greater flexibility in choice of names on header lines in a file. Formats can now be specified with the letter (f or g) specifying the format type (fixed or floating point) at the beginning. Thus "f10.3" is equivalent to "10.3f" Variables can now have labels for each dimension [4.00]. These are used to label output. They may be set by functions vector(), matrix(), array(), structure() and matread(). They may be retrieved by function getlabels(). Many operations propagate labels sensibly. Standard transformations such as sqrt() and log() can have CHARACTER arguments [4.00]. For example sqrt("x1") has value "sqrt(x1)". Keyword 'missing' on print(), write() and paste() [4.00] affects how MISSING values are printed. Keyword 'justify' on paste() [4.00] allows left, right, or centered justification of CHARACTER items. Keywords 'multiline' and 'linesep' on paste() [4.00] allow creation of a CHARACTER vector or multiline CHARACTER scalar from a vector or matrix. You can better control the formatting of the string produced by paste() using keywords 'intwidth' and 'charwidth'. Also the effect of 'format' has been modified. Option related You can now specify options to be retrived by getoptions() by using keyword phrases. For example, getoptions(seeds:T) is equivalent to getoptions("seeds"). setoptions(default:T) sets all options to their default "factory" values, overriding any changes that may have been made by the startup file or later in the run. setoptions(batchecho:F) sets the default echoing behavior of batch() so that batch(fileName) is equivalent to batch(fileName,echo:F) and to get echo you must use batch(fileName,echo:T). Normal behavior is restored by setoptions(batchecho:T). setoptions(warning:F) suppresses most subsequent WARNING messages until a later setoptions(warning:T). This should be used sparingly as some WARNING messages are important. setoptions(pvals:T), setoptions(fstats:T) [4.00] make default output of GLM commands include P-values and F-statistics. On a Macintosh, setoptions(font:"Courier"); setoptions(fontsize:10) resets the font in the current Command Window. On non-Macintosh versions allowing command line editing, setoptions(history:n) [4.00] sets the number of commands that can be recalled to n. Structure related: Structures can now be used as operands in all arithmetic operations (+, -, *, /, ^, %%, %*%, %c%, %C%) and as arguments to all transformations such as sqrt(), cos(), and many functions, including max(), min(), describe(), dim(), sort(), rank() and grade(). The results are structures containing information on all the elements of the argument or the operands. This means that you can do analyses with "ragged" (non-rectangular) data sets. For example, sum(x)/nrows(x) computes the means of all the components structure x. Also dim(str) returns the dimensions of each component of a structure rather than the number of components. You can extract one or more components of a structure by using ordinary subscripts. Thus, for example, if str is a structure with 4 top level components, str[cat(2,3,4)], str[cat(F,T,T,T)], and str[-1] all return a structure omitting the first component of str. cat(str) returns a vector of all the elements in all the components of a structure all of whose components are of the same type, REAL, CHAR or LOGICAL. Complex variable related cmplx(re) is equivalent to cmplx(re, 0*re), that is, zero imaginary part is assumed. hprdh(), hprdhj(), cprdc() and cprdcj() now allow one of their arguments to be a single hermitian or complex series which multiplies all the series in the other argument. Help related Practically all help entries now have one or more keys. For example, help(key:"output") prints a list of all commands assocated with key "output" and help(key:"?") lists all the keys available. Except for the first time help() is used, its response time is much faster than it was. help(alt:T) [4.00] switches the help file to the most recently used alternative help file (set by help(file:fileName)). This complements help(orig:T) which switches to the startup help file. Commands usage() and macrousage() [4.00] give brief summaries of how to use functions and macros help(news) now lists only the most recent three months of news items. Very old news items are in file macanova.nws distributed with MacAnova. help(news:cat(date1,date2)) gives news items between the dates in mmddyy form [4.00]. Miscellaneous hconcat(), vconcat(), diag(), dmat(), triupper(), trilower() and triunpack() all work with CHARACTER data [4.00] sort(), rank(), and grade() all work with CHARACTER data [4.00] You can use keywords on describe() to specify which statistics to compute. For example, describe(x, mean:T, var:T) computes only the mean and variance of x. Functions sum(), prod(), min() and max() now work with LOGICAL arguments, treating True as 1 and False as 0. The result is REAL They also accept multiple vector arguments so that, for example, sum(vec1, vec2,...) is equivalent to sum(cat(vec1,vec2,...)). Functions factor(), split(), and tabs() now accept LOGICAL vectors specifying a factor, with False and True translated as levels 1 and 2. matrix(x) with no row dimension converts a generalized matrix x to a true matrix (only 2 dimensions) [4.00]. outer() can compute products of more than two arguments [4.00]. New keyword 'all' for svd() [4.00]. For example, svd(x,all:T,right:F) returns singular values and left singular vectors. tabs() recognizes keywords 'means', 'vars' and 'counts', allowing greater control of what is computed. cluster() recognizes keyword phrase 'reorder:T' which reorders the printed table of cluster membership so that cases in the same cluster are together. Also, cluster() now standardizes data before computing distances, unless 'standard:F' is an argument. anymissing() and ismissing() accept CHARACTER arguments with "" considered to be a missing value. array(x,n1,n2,n3...) is equivalent to array(x,cat(n1,n2,n3...)). factor(a1,a2,...) is equivalent to factor(cat(a1,a2,...)) [4.00] swp(a,i1,i2,...) is equivalent to swp(a,cat(i1,i2,...)) delete() recognizes keywords 'real', 'char, 'logical', 'structure', 'macro', 'graph', and 'all' to specify classes of variables to delete (keyword value T) or retain (keyword value F). Examples might be delete(graph:T) or delete(all:T,macro:F). list() and listbrief() recognize keywords 'all' and 'keep'. For example, listbrief(all:T, macro:F) lists all non-macro variables and list(real:T,keep:T) returns a CHARACTER vector of the names of all REAL variables. If 'size:T' is an argument to list(), the output will include the total memory usage in bytes of each variable listed. New keyword phrase quiet:T on getseeds() and setseeds() suppresses printed output. putascii(vec,file:fileName) writes the contents of REAL vector vec to disk as ASCII codes. string <- putascii(vec,keep:T) allows you to create strings of arbitrary ASCII codes. putascii(n1,n2,...) is equivalent to putascii(cat(n1,n2,...)). Each command you type is saved as a macro with name LASTLINE. See topic redo. New or revised pre-defined macros toclip and fromclip allow easy copying to and from the Clipboard [4.00] alltrue(log1,log2,...) [4.00] has value True if and only if logical scalars log1, log2, ... all have value True. anytrue(log1,log2,...) [4.00] has value True if and only if at least one of the logical scalars log1, log2, ... any has value True. anovapred(a,b,c..) computes structure of fitted cell means, their standard errors, and standard errors of prediction for the most recent ANOVA model (with no covariates), for which a, b, c, ... must be all the factors. Largely superceded by command glmpred(). breakif(Logical) or breakif(Logical,n) is equivalent to 'if(Logical){break;}' or 'if(Logical){break n;}' labels <- enterchars(Height Weight Concentration Temperature) allows easier entry of CHARACTER data [4.00]. Note the absence of commas and quotation marks. x <- enter(1 2.3 -4.5 6 7 ...) allows easier entry of REAL data [4.00]. Note the absence of commas. haslabels(x) is True if and only if x has labels [4.00]. hist draws a histogram of its first argument. Usage is hist(y), hist(y,nbins), or hist(y,bins), where y is a vector, nbins is a positive integer, and bins is an increasing sequence of bin boundaries with min(bins) <= min(y) and max(bins) > max(y). See also new function bins(). makecols(x, x1,x2,...,xk) is equivalent to makecols(x, cat("x1","x2",...,"xk")). more(macroName) and more(var) allow convenient scanning of a long macro or large variable (Unix only) [4.00] redo() re-executes the previous line (saved as LASTLINE) by turning it into macro REDO and then executing REDO. readcols(fileName,x1,x2,...,xk) is equivalent to readcols(filename, cat("x1","x2",...,"xk")). resvsindex, resvsrankits and resvsyhat now accept a CHARACTER variable to specify a plotting character. yhat, resid, resvsindex, resvsrankits and resvsyhat now work correctly after weighted analysis and non-linear GLM commands such as poisson. New macros in MacAnova.mac bargraph draws a bargraph of its second argument, using its first argument as bar boundaries. Usage is bargraph(boundaries, y), where both boundaries and y are vectors, with length(boundaries) = length(y) + 1. Alteratively bargraph(cat(FirstBndry,width),y) uses cat(FirstBndry,FirstBndry+width,FirstBndry+2*width,...) as boundaries. rsample allows selection of random samples, with or without replacement, from the rows of a matrix. New macros in Tser.mac arspectrum estimates the spectrum of a time series by fitting an auto- regressive model by solving the Yule-Walker equations. Usage is arspectrum(y,p) or arspectrum(y,p,S) where y is a REAL vector and p and S are positive integers. p is the order of the autoregression fit (the number of lags in the autoregression) and S, if present is the number of frequencies to use in computing the spectrum. If S is omitted, it is assumed to be the smallest power of 2 greater than 2*length(y)-1. evalpoly(coef,z) evaluates the polynomial(s) z^n+coefs[1,]*z^(n-1) + ... + coef[n-1,]*z + coef[n,], where coef is a n by p REAL matrix and z is a N by 2*p REAL matrix considered as a complex matrix For example, evalpoly(coef,polyroot(coef)) should be zero within rounding error evalpoly(coef,x,real:T) does same except x is considered to be a real matrix burg(y, nlags [,degree:d] [,S:m]) uses burg algorithm to do "maximum entropy" spectrum estimate at S=m equally spaced frequencies, using an AR(nlags) model, optionally detrending with a polynomial of degree d dpss(N, W, K [,FirstVec]) computes a matrix whose columns are the K discrete prolate spheroidal sequences starting the FirstVec-th one (default 1). multitaper(y, W, K [,degree:d] [,S:nFreq]) computes a matrix whose K columns are multi-taper estimates of the spectrum of y, optionally detrended by a polynomial of order d. It requires macros dpss and detrend. Things specific to the Macintosh version You can have up to 9 command/output windows. When one fills up, you are given a chance to save it, and a new window is created to continue output in. Only the frontmost command window is active. When you type right parentheses and brackets (')', ']' and '}'), matching left parentheses and brackets are briefly highlighted. If none is found, a warning beep is sounded. There is now a non-interactive mode of operation. If you hold the command key down during launching, you are given an opportunity to select a file of a commands and to specify a file to which the output is written. Apple Menu Help has been moved here File menu Open now reads the selected file into a new editable command window rather than into the current command window. Save Window and Save Window As replace Save Output As. There are separate Save Workspace and Save Workspace As entries. A new Go On item has been added for use when pausing after drawing a graph. When you Quit you are asked whether you want to save the workspace and/or save the contents of the the output window(s). This can be bypassed by holding down the option key. The Quit and Save entry has been eliminated. Edit Menu Undo has been enhanced, allowing more things to be undone, and allowing you to Redo changes you have just undone. See help topic macintosh. Windows Menu Entry New Window allows you to open additional command/output windows. Each such window has an entry on the menu. There are entries Page Up and Page Down in addition to Go To Top and Go To End. Command Menu The 8 command items can be selected from the keyboard by Command Option 1, Command Option 2, ..., Command Option 8, or by keys F5, F6, ..., F12 on an extended keyboard. Options Menu Entries on this allow you to set a number of options available on command setoptions(). Font Menu Entries on this allow you to set the font and font size to be used in the current command window. If you resize or zoom a graphics window other than the Panel of Graphs, the new size is remembered and will be used for the next plot to that window. CHARACTER pseudo variable with name CLIPBOARD whose value is the current text contents of the ClipBoard. You can assign REAL or CHARACTER variables to CLIPBOARD, and they become the current text contents of the Clipboard [4.00]. Pre-defined macros fromclip and toclip make use of the feature quite easy. Things specific to the DOS versions After high resolution plotting, the contents of the screen are refreshed so you can see recent commands and output. There are two DOS versions, real mode and protected mode. The real mode version should run as a DOS program on any DOS/Windows machine. Under Windows, you can copy high resolution graphics and paste them in to other programs. However, no variable can be larger than 65,000 bytes (8125 REAL values). The protected mode version allows you to have variables whose size is limited only by your computer's memory and hard disk space. It also runs as a DOS program. It cannot make high resolution plots while Windows is running. In the protected mode version, keyword phrase 'screendump:fileName' on a plotting command such as plot(), showplot() and boxplot() saves a bitmapped copy of the graph to be written to file fileName. This is not available on the real mode version. The protected mode version, but not the real mode version allows command line editing and recall of previous commands (history) [4.00]. CHARACTER variables HOME and DATAPATH are pre-defined to have the name of the directory where MACANOVA.EXE is located. Variables DATAFILE and MACROFILE are pre-defined to be the equivalents of paste(HOME,"macanova.dat",sep:"") and paste(HOME,"macanova.mac", sep:""). Things specific to Unix versions Most Unix versions allow command line editing and recall of previous commands (history) [4.00]. CHARACTER variables HOME and DATAPATH are pre-defined to have the name of the user's home directory (value of envirnomental variable $HOME). Variables DATAFILE and MACROFILE are pre-defined to be the equivalents of paste(HOME,"macanova.dat",sep:"") and paste(HOME,"macanova.mac",sep:""). Please report any problems to kb@stat.umn.edu. Gary W. Oehlert gary@stat.umn.edu Christopher Bingham kb@stat.umn.edu Department of Applied Statistics 1994 Buford Ave. St. Paul, MN 55108 April 17, 1996