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

Example:

The following example references a file sample2.asc, included with $ {\mathfrak{E}I}$, that includes data from 100 precincts in rows along with four variables, v, t, x, and n, in columns.
new;                          @ clear workspace @
library ei;                   @ initialize libraries @
clear v,t,x,n;                @ clear all variables @
loadvars sample2.asc v t x n; @ load variables from disk file @
dbuf = ei(t,x,n,1,1);         @ estimate betaB and betaW @
save racevote=dbuf;           @ save dbuf in file racevote.fmt @
dbuf2 = ei2(v,dbuf,1,1)       @ estimate lambdaB and lambdaW @
save raceDem=dbuf2;           @ save dbuf2 in file raceDem.fmt @

For example, given the $ 2\times 3$ running example in the book (Table 2.2, Page 30), eiread(dbuf,"betab") are point estimates of $ \beta_i^b$, the fraction of blacks who vote; eiread(dbuf,"betaw") are point estimates of $ \beta_i^w$, the fraction of whites who vote; eiread(dbuf2,"betab") are point estimates of $ \lambda_i^b$, the fraction of blacks who vote Democratic, among those who vote; and eiread(dbuf2,"betaw") are point estimates of $ \lambda_i^w$, the fraction of whites who vote Democratic, among those who vote.



Gary King 2006-09-13