[R-gui] basic-statistics GUI for R

John Fox jfox at mcmaster.ca
Mon May 12 21:31:53 MEST 2003


Dear R-gui list members,

I've written a basic-statistics GUI for R using the tcltk package. I'd be 
grateful if members of this list took a look at what I've done to offer 
comments and suggestions. Here's some orienting information. (Of course, 
please feel free to ignore this long-winded message if it isn't of interest).

The GUI consists of a window, which I call the "R Commander," containing 
several menus, buttons, and information fields. (The menu tree, etc., are 
shown at the end of this message.) In addition, the Commander window 
contains a log/script box.

The menus lead to simple dialog boxes, the general contents of which are 
more or less obvious from the names of the menu items. These boxes have a 
common structure, including a help button leading to the help page for a 
relevant function.

Commands generated via the dialog are posted to the R session window, along 
with printed output, and to the log window. Lines in the log window may be 
edited and (re)submitted for execution.

Commands access a current or active data set (data frame). When a new data 
set is read (from a text file, from an attached package, or imported), it 
becomes the active data set. The user can also select an active data set 
from among data frames currently in memory.

In addition to standard packages, the Commander uses some functions in my 
car package. I should mention that the scatterplot and scatterplot.matrix 
functions in the car package currently generate warning messages. This is 
not a problem specific to the Commander and will be fixed in the next 
release of car.

My object in designing and implementing this GUI was to cover the content 
of a basic-statistics course. The target text was Moore's The Basic 
Practice of Statistics, Second Edition (Freeman, 2000), which is the text 
that I use for a two-semester introduction to statistics for undergraduate 
sociology majors. The R Commander implements the content of this text plus 
some additional material (e.g., linear and generalized linear models).

I must confess that I'm not terribly enamored of menu/dialog box interfaces 
to statistical software, but I do feel that these interfaces have a role 
for introductory and occasional use. The Commander interface is not 
innovative, but I hope that it's simple and familiar. One of my design 
goals was to wean users from the GUI to writing commands, which is one 
motivation for the log/script window.

It should be relatively easy for me to add statistical functionality to the 
R Commander, and I'd appreciate suggestions for what you'd like to see 
implemented. Please remember, however, that my intention is to keep things 
simple and basic. In particular, I don't like extensive menu/dialog-box 
interfaces to large statistical systems that attempt to provide access to 
every option and procedure. In R, of course, which relies on scores of 
contributed packages, this is not feasible anyway.

I'm making the GUI available as the Rcmdr package. For now, you can get a 
copy of the package (or a version compiled for Windows) from my web site. 
When I've had a chance to assimilate people's suggestions, I'll contribute 
the package to CRAN. I should mention that I've only tested the package 
under Windows, but my intention is for it to work on other platforms as 
well. I'd very much appreciate learning whether it does. You can find the 
package, along with a screen shot, at 
<http://www.socsci.mcmaster.ca/jfox/Misc/Rcmdr/>.

On Windows, the package works properly only with the single-document Rgui 
interface (sdi). Under the default multiple-document interface (mdi), Tk 
dialog boxes don't stay on top of the main R window. I think that this is a 
known problem with the tcltk package under Windows. (If anyone knows a 
solution, I'd appreciate learning of it -- I prefer the sdi, but most of my 
students do not.)

Finally, I'd like to mention that I found Peter Dalgaard's marvellous tcktk 
package a pleasure to work with.

Thanks for your attention,
  John



R Commander menu tree:

File - Read data set from text file
     |- Read data set from attached package
     |- Import data - from SPSS data set
     |             |- from Minitab data set
     |- Save log as

Data - Select active data set
     |- List data sets in packages
     |- Recode variable
     |- Compute new variable

Statistics - Summaries - Numerical summaries
           |           |- Frequency distribution
           |           |- Table of statistics
           |           |- Correlation matrix
           |- Contingency Tables - Two-way table
           |                    |- Multi-way table
           |- Means - Single-sample t-test
           |       |- Independent-samples t-test
           |       |- Paired t-test
           |       |- One-way ANOVA
           |       |- Multi-way ANOVA
           |- Proportions - Single-sample proportion test
           |             |- Two-sample proportions test
           |- Variances - Two-variances F-test
           |           |- Bartlett's test
           |           |- Levene's test
           |- Nonparametric tests - Two-sample Wilcoxon test
           |                     |- Paired-samples Wilcoxon test
           |                     |- Kruskal-Wallis test
           |- Fit models - Linear regression
                        |- Linear model
                        |- Generalized linear model

Graphs - Histogram
       |- Stem-and-leaf display
       |- Boxplot
       |- Scatterplot
       |- Scatterplot matrix
       |- Bar graph
       |- Pie chart

Models - Select active model
       |- Summarize model
       |- ANOVA table
       |- Basic diagnostic plots
       |- Component+residual plots
       |- Added-variable plots

Distributions - Normal distribution - Normal quantiles
              |                     |- Normal probabilities
              |- t distribution - t quantiles
              |                |- t probabilities
              |- Chi-squared distribution - Chi-squared quantiles
              |                          |- Chi-squared probabilities
              |- F distribution - F quantiles
              |                |- F probabilities
              |- Binomial distribution - Binomial quantiles
                                      |- Binomial tail probabilities
                                      |- Binomial probabilities


Buttons: Edit data set; View data set; Submit (lines from the log/script 
window)

Information fields: active data set; active model

Check box: Log commands

-----------------------------------------------------
John Fox
Department of Sociology
McMaster University
Hamilton, Ontario, Canada L8S 4M4
email: jfox at mcmaster.ca
phone: 905-525-9140x23604
web: www.socsci.mcmaster.ca/jfox



More information about the R-SIG-GUI mailing list