R program:
Here is the code block that creates roll calls from Thermometer Comparisons
nrollcall <- (nq*(nq-1))/2
LDATA <- rep(0,np*nrollcall)
dim(LDATA) <- c(np,nrollcall)
for (i in 1:np){
jj <- 0
for (j in 1:(nq-1)){
for (k in (j+1):nq){
jj <- jj + 1
#
if(!is.na(T[i,j])){
if(!is.na(T[i,k])){
#
if(T[i,j] > T[i,k])LDATA[i,jj]=1 If the Thermometers are equal then it is treated as missing data
if(T[i,j] < T[i,k])LDATA[i,jj]=6
}
}
}
}
}
mode(LDATA) <- "double"
#
hr <- rollcall(LDATA,yea=1,nay=6,missing=0,notInLegis=9,
legis.names=NULL, vote.names=NULL, legis.data=NULL, vote.data=NULL,
desc=NULL, source=NULL)
result <- oc(hr, dims=2, polarity=c(1,2))
#
Here is how to select just the cutting lines for Wallace
#
# PLOT JUST THE WALLACE CUTTING LINES
i <- 1
#
while (i <= 11){
#
etc. etc.
Here is how to select just the cutting lines for Humphrey
#
# PLOT THE HUMPHREY CUTTING LINES
#
kkk <- NULL
kkk[1] <- 1
kkk[2:11] <- 12:21 Humphrey's cutting lines are 1, and 12-21
#
for (iii in 1:11){
i <- kkk[iii]
#
- Run the program and turn in the pair of two panel plots that it produces.
- Turn in summary(result) NEATLY FORMATTED and report result$fits.
- Add the code necessary to do a third two panel plot showing the cutting lines for Nixon and LBJ. Turn in the plot
and the short code block (similar to the one above for Humphrey) you used to get the cutting lines for Nixon and
LBJ, respectively.