.BG
.FN plotfit
.TL
Two-way Plot of Fit
.CS
plotfit(fit, w=0, c=-1, rowlab, collab, grid=TRUE)
.AG fit
object with components `row', `col', `grand', and `resid',
reflecting a two-way fit to a matrix.  See, for example, the
output of function `twoway'.
Missing values (`NA's) are allowed in components of `fit'.
.AG w
interaction term, i.e., the coefficient of the row*col
interaction.
The residuals in `fit' should NOT reflect this term, i.e.,
`data[i,j]' equals `grand + row[i] + col[j] + resid[i,j]'.
.AG c
residuals larger in magnitude than `c' will be displayed.  If
`c<0', no residuals will be displayed; if `c=0', all residuals
will be displayed.
.AG rowlab
character vector giving labels for the rows of the matrix.
Defaults to "Row i".
To omit labels, use `rowlab=""'.
.AG collab
character vector giving labels for the columns of the
matrix.
Defaults to "Col i".
To omit labels, use `collab=""'.
.AG grid
should grid of fitted values be drawn?
.GR
.SA
`twoway'.
.EX
plotfit(twoway(datamat))

# the example plot is produced by:
vy <- votes.year[27:31] #get last five election years
vr <- twoway(votes.repub[1:10,27:31]) #first 10 states, last 5 years
plotfit(vr,c=8,rowlab=state.name,collab=vy)
title(main="Twoway Fit to Republican Votes",
      sub="10 States for 1964 - 1972")
.PI
.KW array
.KW hplot
.WR
