# # # # basicspace_AM.r -- Does Aldrich-McKelvey Scaling of 1968 Urban Unrest # 7-Point Scale # # &&&&&&&&& STIMULI &&&&&&&& # # 1968 7-POINT URBAN UNREST SCALE # # CAND(1)= 'LYNDON JOHNSON ' # CAND(2)= 'HUBERT HUMPHREY ' # CAND(3)= 'RICHARD NIXON ' # CAND(4)= 'GEORGE WALLACE ' # CAND(5)= 'INDIVIDUAL ' # # # &&& First two rows of URBAN_UNREST_1968.TXT -- The columns are: # ID number # LBJ # HHH # Nixon # Wallace # Self Placement # # 1 4 2 4 6 4 # 2 3 2 4 6 1 # 3 9 9 9 9 9 # 4 3 6 4 7 7 # etc. # # Note that the read.table puts the ID number into row.names thereby # dropping the column. # rm(list=ls(all=TRUE)) # library(MASS) library(basicspace) # T <- as.matrix(read.table("C:/basicspace/urban_unrest_1968.txt",row.names=1)) TT <- T mode(TT) <- "double" colnames(TT) <- c("lbj","hhh","nixon","wallace","self") # # Note that polarity=1 selects Lyndon Johnson -- The Respondent Self Placement # is in the last column -- respondent=5 # result <- aldmck(TT,polarity=1,respondent=5,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 #