# # # # basicspace_blackbox_transpose.r -- Analyzes 2004 Liberal-Conservative 7-Point # Scale in 2 dimensions -- A generalization # Aldrich-McKelvey Scaling # # # &&&&&&&&& STIMULI &&&&&&&& # # 2004 7-POINT LIBERAL-CONSERVATIVE 7-POINT SCALE # # BUSH # KERRY # NADER # D-PARTY # R-PARTY # # rm(list=ls(all=TRUE)) # library(MASS) library(foreign) library(basicspace) setwd("C:/basicspace") data <- read.dta("anes2004.dta") attach(data,warn.conflicts = FALSE) # T <- cbind(V043087,V043088,V043089,V043090,V043091) TT <- T mode(TT) <- "double" colnames(TT) <- c("Bush","Kerry","Nader","D-Party","R-Party") # # result <- blackbox_transpose(TT,missing=c(0,8,9),dims=2,minscale=4,verbose=F) # # # ---- Useful Commands To See What is in an Object # # > length(result) # [1] 9 # > class(result) # [1] "blackbt" # > names(result) # [1] "stimuli" "individuals" "fits" "Nrow" "Ncol" # [6] "Ndata" "Nmiss" "SS_mean" "dims" # > summary(result) -- shows everything # # result$fits # SSE SSE.explained percent SE singular #Dimension 1 3185.614 14710.84 82.19975 1.0677839 136.2731 #Dimension 2 1149.253 16747.20 11.37857 0.8083044 99.2922 # detach(data)