Gary King Homepage Previous: Purpose: Up: EI Next: Globals:

Example:

The following example uses the sample file sample.asc that comes with $ {\mathfrak{E}I}$. This file includes hypothetical data from 75 precincts in rows and three variables, t, x, and n, in columns. You may use any other variable names or ASCII files and may include recodes or other Gauss commands in this file.
new;                        @ clear workspace @
library ei;                 @ initialize libraries @
clear t,x,n;                @ clear all variables in dataset @
loadvars sample.asc t x n;  @ load variables from disk file @
dbuf = ei(t,x,n,1,1);       @ run ei @
save racevote=dbuf;         @ save dbuf in file racevote.fmt @
The command loadvars is a keyword included with this program that makes it easy to read variables in from an ASCII data set (see page [*] below). If your data are in a Gauss data file, use subdatv instead (see page [*] below). Because running ei takes several minutes, it is usually easiest to write one program such as this, and to examine the results interactively (or with a separate program) using eiread and eigraph.



Gary King 2006-09-13