.BG
.VE $Header: /usr3/s/current/s/.help/RCS/plotfit,v 1.2 83/12/30 19:32:16 rab Exp $
.FN plotfit
.TL
plotfit: Two-way Plot of Fit
.CS
plotfit(fit, w, c, rowlab, collab, grid)
.PP
.AG fit
structure 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 (NAs) are allowed in components of `fit'.
.AG w
interaction term, i.e., the coefficient of the row*col
interaction.  Default 0.
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.  Default \-1.
.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? Default TRUE.
.PP
Graphical parameters may also be supplied as arguments to this
function (see `par').
.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=encode(vy))
title(main="Twoway Fit to Republican Votes",
      sub="10 States for 1964 - 1972")
.PI
.KW plot*
.KW array*
.KW hplot*
.WR
