About RGA Utils

This started as a collection of small snippets of R code that I kept copying from project to project. Much of it started life in one of the packages that eventually went into CPTtools, but I thought it might be useful beyond that.

Then I started getting interested in the use of Al Beaton's sweep operator in missing data problems. I found that the Beaton's sweep operator (different from the built-in R/S sweep function) was not readily available in any R package. I started building that and other matrix operators found in Dempster's 1969 book on multivariate statistics. (I found a couple of typographical errors in some of the examples, which are fully re-created in the examples distributed with the package).

I also noticed that although JAGS had a categorcial distribution, R did not have one built-in. So I added that to this collection as well.

Key functions

This package is a loose collection of hopefully useful functions. Here are some key functions that can be used as a starting point for exploring the package:
This performs a regression restricted by a Q-matrix, a logical matrix indicating which coefficients should be non-zero. It handles weights and missing data.
This provides rcat and dcat functions for nominal categorical data as well as docat, pocat, qocat and rocat functions for ordered categorical data. It also provides a median.ordered method for ordered factors.
This produces an array of colors that differ by staturation or saturation and value, and not by hue. This is good for producing graphs that both look good in color and retain their legibility when printed in grayscale.
This is a serialization function for R objects.
This is Al Beaton's sweep operator, which regresses out variables in a normal distribution. It also provides an interative method for inverting a matrix.
This separates numeric and non-numeric columns in a data frame.
This produces a matrix of sums and sums of squares from weighted data.

RGAUtils Talks and Papers

Here are slide for the presentation I gave at the Florida Educational Research Assoication conference in 2016.

RGAutils License Information

RGAutils is made available under the Artistic License, version 2.0.

Current Version Status

The current version (0.1-4) is mostly debugged and documentation Also included in the new version are R datasets corresponding to ACED.

CPTtools Releases

The following releases are archived here:
ReleaseSourceWindows BinaryMac BinaryManualNotes
0.1-4RGAutils_0.1-4.tar.gz Early alpha release
Currenty, all of the code is written in pure R, so the source code version should install cleanly on all systems. (If installing from the R menus, you need to select "Install source package...")

Development Version

The latest development version is available as a subversion repository at: https://pluto.coe.fsu.edu/svn/common/RGAutils/.

If you have patches or other correspondence about RGAutils you can contact me at almond@acm.org. If you are filing a bug report, please be sure to include:

  1. The version number of CPTtools and R that you are using.
  2. Your operating system and whether it is 64 or 32 bit.
  3. The exact text of any error message that is generated.
  4. A small script that reproduces the problem (if at all possible).


Beaton, A. E. (1964). The Use of Special Matrix Operators in Statistical Calculus. Educational Testing Service Research Report RB-64-51.

Dempsters, A. P. (1969). Elements of Continuous Multivariate Analysis. Addison-Wesley.

Legal Notices

The software is offered AS IS, without any warranty of any kind. Support is provided on a volunteer basis, and may not be immediately forthcoming.

Site last updated on 2016-11-03.