# # # # basicspace_blackbox_transpose.r -- Analyzes 1980 Liberal-Conservative 7-Point # Scale in 3 dimensions -- A generalization # Aldrich-McKelvey Scaling # # # &&&&&&&&& 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 # Kennedy # Anderson # R-Party # D-Party # # 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:2)] then drops the voted for # column and the Respondent Self Placement leaving just the 6 Stimuli # rm(list=ls(all=TRUE)) # library(MASS) library(basicspace) setwd("C:/basicspace") # # T <- as.matrix(read.table("C:/basicspace/lc1980v.dat",row.names=1)) # #> dim(T) #[1] 888 8 # #> table(T[,5]) # # 1 2 3 4 5 6 7 8 #197 295 141 117 62 24 15 37 # # # THIS REPRODUCES THE EXAMPLE IN MY 1998 ON-LINE APPENDIX FOR THE 1980 L-C SCALE # TT <- T[,-(1:2)] mode(TT) <- "double" # 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 3435.348 10532.36 75.40507 1.0375809 95.38365 #Dimension 2 1892.360 12075.34 11.04682 0.9076563 61.26916