# # # # basicspace_AM.r -- Does Aldrich-McKelvey Scaling of 1980 Liberal- # Conservative 7-Point Scale # # &&&&&&&&& STIMULI &&&&&&&& # JIMMY CARTER # RONALD REAGAN # TED KENNEDY # JOHN ANDERSON # REPUBLICAN PARTY # DEMOCRATIC PARTY # # &&& First two rows of LC1980V.DAT -- The columns are: # ID number # who voted for 0=not vote, 1=Reagan, 2=Carter, 6=Anderson # self placement # Carter # Reagan # # 1 0 6 2 6 1 7 5 5 # 8 0 6 4 6 4 7 6 4 # # Note that the read.table puts the ID number into row.names thereby # dropping the column. The TT <- T[,1] then drops the voted for # column leaving the Respondent Self Placement and the 6 Stimuli # rm(list=ls(all=TRUE)) # library(MASS) library(basicspace) # T <- as.matrix(read.table("C:/basicspace/lc1980v.dat",row.names=1)) TT <- T[,-1] mode(TT) <- "double" colnames(TT) <-c("self", "Carter", "Reagan", "Kennedy", "Anderson", "R-Party", "D-Party") # # Note that polarity=2 selects Jimmy Carter -- The Respondent Self Placement # is in the first column -- respondent=1 # result <- aldmck(TT,polarity=2,respondent=1,missing=c(0,8,9),verbose=TRUE) # # # ---- Useful Commands To See What is in an Object # # > length(result) # [1] 8 # > class(result) # [1] "aldmck" # > names(result) # [1] "stimuli" "respondents" "eigenvalues" "AMfit" "R2" # [6] "N" "N.neg" "N.pos" # > summary(result) -- shows everything #