如何在 SPSS 中创建一个变量来计算有多少其他案例具有相同的 ID

问题描述 投票:0回答:1

尝试在 SPSS 上解决一个难题。

我正在尝试找到一种方法,根据名为

Mother_ID
的变量来计算每个人(或个案)有多少兄弟姐妹。它基本上会计算有多少其他案例与当前记录具有相同的
Mother_ID
。有没有办法做到这一点?

谢谢!

Count within case 不适用于这个问题,因为数据库中有太多不同的

Mother_ID

variables count spss
1个回答
0
投票

AGGREGATE
是你最好的朋友: https://www.ibm.com/docs/en/spss-statistics/29.0.0?topic=reference-aggregate

AGGREGATE 
/BREAK = Mother_ID
 /N_of_siblings = N(Mother_ID).

这将创建一个名为 N_of_siblings 的新变量;对于每条记录,它会显示有多少记录共享相同的

Mother_ID

© www.soinside.com 2019 - 2024. All rights reserved.