Polisのデータを解析
PolisのデータをPython自前スクリプトで解析
2023-06-21
59 peopleのデータが得られた
pyimport pandas as pd
df = pd.read_csv("/Users/nishio/Downloads/polis.csv")
matrix = df.pivot_table(index="pid", columns="tid", values="vote")
print(matrix)
75 rows
pymatrix = matrix.dropna(thresh=3)
print(matrix.shape)
# => (59, 8)
論文には7が閾値って書いてあったけど実際は3のようだ
K-3
0 12
1 36
2 11
うーん、それっぽい絵はできたけど結果が一致しないな
できた
:comment 7
Count of +1 votes in group: 0.0
Count of 0 votes in group: 2.0
Count of -1 votes in group: 12.0
Count of +1 votes outside group: 19.0
Count of 0 votes outside group: 19.0
Count of -1 votes outside group: 7.0
pvalue: 5.840739168435112e-05
Polisのバックエンド実装を使わずに、投票データのCSVからPolisのクラスタわけやクラスタごとの「特徴的な回答」を計算できるようになった
2023-06-22