ASLGREG reviewed
Vector 9:2, page 32
Transcribed from the printed issue; not yet reviewed. Read it in the PDF of the issue, page 32
Having only worked in an APL environment for just under a year I feel I can only really review this package on a statistical level. I have not yet developed enough prejudices in the APL world to inflict on you all. (Some might argue otherwise!) This workspace is the first of the regression volumes and contains ‘functions that perform GLIM type calculations in a way that allows them to be incorporated into user functions.’
Data Entry¶
There are no utilities included within the workspace to help with data entry. But remember that the package is written as a set of independent utilities. Hence, you can bolt on your own preferred data management utilities. All the package expects is a set of APL vectors for analysis.
Data Analysis¶
The documentation for this workspace starts off with an excellent introduction to regression which I would recommend to anybody. Then we are presented with some examples of the code working on a real problem. Working through this, the function names seem to have a Genstat type feel to them, but without some of the tedious features of that package (e.g. the term command). You simply declare the dependent variable using YVAR varname. You can then try to fit explanatory variables using FIT 'GM+VAR1+VAR2....etc'. The term GM is the intercept coefficient and is required if you are not trying to fit a line through the origin (referring to Grand Mean vector). A fit produces results of the form:
Source ss df ms
------ -- -- --
Due to model 9864.6 1 9864.6
Residual 12576 27 465.78
---------------------------------------------------
Total corrected 22441 28 801.45
Percentage variation accounted for = 43.96
F-statistic 21.18
p-value = 0.00
Presentation of results throughout the system is kept to the bare minimum of requirements — after all we can all add our own little display functions if we want.
The precision throughout the system is controlled by ⎕PP. Estimate values can be displayed, as can fitted values and t-residuals. Quadratic relationships can be fitted. Qualitative variables can be fitted by declaring a factor using FACTOR varname. The results of fitting a parameterisation are displayed using corner-point parameterisation, which again is similar to Genstat. As the documentation points out, it is a piece of cake to convert these into group mean estimates using a little APL.
Advanced features¶
A function called TESTHYP allows you to test several hypotheses at once and judge whether the reduction in residual sum of squares due to the inclusion of extra variables is significant. For those of us who want all the work done for us (that’s me) there is a STEPWISE function which runs through the potential explanatory variables selecting/rejecting the ones which explain most/least of the variation in the dependent variable, depending on the F-levels that you pass it.
More advanced features include weighted least squares, leverage, cooks distance, which allow us to progress even when some of the Normal assumptions start to collapse. There are nine link functions (Genstat had eight) and six error distributions (Genstat had 5). But the beauty of these is that with a little help from the example in the documentation it becomes very easy to customise your own link functions.
Results¶
How does it all work in practice? On the whole it all seems to work correctly. The type of environment feels similar to interactive Genstat. Of course not all the functionality of that package is contained within this one volume; bits missing are the prediction-type functions and the fitcurve-type functions. But again it is possible to bolt these features on yourself. Missing values do not seem to be supported at all. Genstat allows regression on data sets with missing values in, although whether this is really required can be argued. It would certainly be worthwhile considering missing values at this stage in the evolution of ASLGREG as the method of representation could be a contentious issue.
Summary¶
Using a set of regression functions from within APL seems to me to be the ideal environment for manipulating data. In the past I have felt frustrated at not being able to get quite what I want from existing packages. These functions (and the documentation) are at a low enough level to build on if you require a more advanced interface — for example graphics etc., but they are also at a high enough level for them to run unaided and produce the required results on the screen. One slight gripe is that there seem to be a few hardcoded lengths to format results on the screen, and if you run the functions with pathological data it can crash trying to put pathological results on the screen … some would say it is the best way to draw attention to such data errors!
Availability¶
ASLGREG is available from the British APL Association, c/o Rowena Small at the address on the inside back cover. The cost is £10 plus £2 postage and packing (UK). For order forms, please contact Rowena.