各位先進好:
後學在使用政治學界的w-nominate時遇到了問題,無論結果怎麼跑,最後產出的coord1d都是呈現1與-1,沒有更大的variation,想請問各位先進,是否是後學的語法有錯誤?最後也附上語法及使用檔。
porkwnominate <- as.matrix(porkwnominate)
porkwnominate[1:113, 1:182]
names <- porkwnominate[, 1]
legData <- matrix(porkwnominate[, 2], length(porkwnominate[, 2]), 1)
colnames(legData) <- "party"
porkwnominate <- porkwnominate[, -c(1, 2)]
pork <- rollcall(porkwnominate, yea = c(1), nay = c(4), missing =0,
notInLegis =9 , legis.names = names,
legis.data = legData)
result <- wnominate(pork, dim=2, polarity =c(39,44))
summary(pork)
summary(rc)
summary(result)
plot(result)
library(wnominate)
library(pscl)
porkwnominate <- as.matrix(porkwnominate)
porkwnominate[1:113, 1:182]
names <- porkwnominate[, 1]
legData <- matrix(porkwnominate[, 2], length(porkwnominate[, 2]), 1)
colnames(legData) <- "party"
porkwnominate <- porkwnominate[, -c(1, 2)]
pork <- rollcall(porkwnominate, yea = c(1), nay = c(4), missing =0,
notInLegis =9 , legis.names = names,
legis.data = legData)
result <- wnominate(pork, dim=2, polarity =c(39,44))
summary(pork)
summary(rc)
summary(result)
plot(result)