# # # # basicspace_AM.r -- Does Aldrich-McKelvey Scaling of 2004 Liberal-Conservative # 7-Point Scale # # &&&&&&&&& STIMULI &&&&&&&& # # 2004 7-POINT LIBERAL-CONSERVATIVE 7-POINT SCALE # # SELF PLACEMENT # BUSH # KERRY # NADER # D-PARTY # R-PARTY # # rm(list=ls(all=TRUE)) # library(MASS) library(foreign) library(basicspace) #setwd("C:/basicspace") data <- read.dta("C:/uga_course_2015/anes2004.dta") attach(data,warn.conflicts = FALSE) # T <- cbind(V043085,V043087,V043088,V043089,V043090,V043091) TT <- T mode(TT) <- "double" colnames(TT) <- c("self","Bush","Kerry","Nader","D-Party","R-Party") # # Note that polarity=3 selects John Kerry -- The Respondent Self Placement # is in the first column -- respondent=1 # result <- aldmck(TT,polarity=3,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 # > plot(result) -- shows basic plots of results # detach(data)