如何用SPSS模糊命令修复案例控制匹配 [英] How to fix case-control matching with SPSS fuzzy command

查看:148
本文介绍了如何用SPSS模糊命令修复案例控制匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在数据中创建1:4案例对照匹配,但最终数据集不包含任何控件.为什么呢?

I am trying to create a 1:4 case-control match in my data, but the final dataset does not incldue any controls. Why is it?

我正在使用SPSS 23进行745,414观察,595,388对照和150026例(1:4比率为20.1%).这些病例和对照已经按照年龄和性别进行匹配,但是我正在尝试创建五个观察值的集群(1个病例和4个对照),每个观察值都标有特定的ID.

I am using SPSS 23 with 745,414 observations, 595,388 controls and 150026 cases (20.1% a 1:4 ratio). The cases and controls are already matched for age and sex, but I am trying to create clusters of five observations (1 case and 4 controls), each marked with a specific ID.

这是我一直在使用的代码:

This is the code I've been using:

FUZZY BY =年龄性别Supplierid =供应商newdemanderidvar = sid group = case

FUZZY BY=age sex supplierid=supplier newdemanderidvar=sid group=case

%% sex的年龄范围是8-88m,可以取两个值(1或2),"supplier"是从1到745,414的序列号,"case"表示观察结果是案例(1)还是对照(0).%%

%%sex ranges from 8-88m age can take two values (1 or 2), "supplier" is a serial number from 1 to 745,414 and "case" marks whether the observation is a case (1) or control (0).%%

我还尝试过分离文件以控制和案例数据集,并使用略有不同的代码:

I also tried seperating the file to control and cases datasets, and uses a slightly different code:

我希望结果如以下示例所示:

I expected the results to be as in the following example:

但控件只是从新的 ID 变量中排除:

But instead the controls are simply excluded from the new ID variable:

知道为什么会这样吗?

Any idea why this happens?

推荐答案

您的FUZZY命令看起来不完整.通常可以从程序本身执行的操作中学到很多东西.尝试使用数据->案例控制匹配..."菜单来设置分析,并查看粘贴的命令语法与您的命令语法有何不同

Your FUZZY command looks incomplete. A lot can often be gleaned from what the program will do on it's own. Try the "Data -> Case Control Matching..." menus to setup your analysis and see how different the pasted command syntax is from yours

您的用户:

FUZZY BY=age sex supplierid=supplier newdemanderidvar=sid group=case

由用户界面粘贴

FUZZY BY=age sex SUPPLIERID=supplier NEWDEMANDERIDVARS=sid GROUP=case EXACTPRIORITY=FALSE MATCHGROUPVAR=id 
 /OPTIONS SAMPLEWITHREPLACEMENT=FALSE MINIMIZEMEMORY=TRUE SHUFFLE=FALSE.

当然,上述命令是默认的,但是在您指定了使作业运行的最小值之前,UI不会允许您退出该命令.

Granted, there are defaults to the above command, but the UI wonlt let you out of it until you've specified the minimum values to make the job run.

这是我的示例语法,用于创建我认为您正在描述的数据集,并对它运行FUZZY.

Here is my example syntax to create a dataset like I think you are describing, and run FUZZY against it.

* Encoding: UTF-8. 

DATASET CLOSE ALL.
NEW FILE.
OUTPUT CLOSE ALL.

INPUT PROGRAM. 
LOOP supplier = 1 TO 745414. 
COMPUTE case =  (mod($CASENUM,4)=0). 
COMPUTE age = SUM(TRUNC(UNIFORM(80)),8). 
COMPUTE sex = SUM(TRUNC(UNIFORM(2)),1). 
END CASE. 
END LOOP. 
END FILE. 
END INPUT PROGRAM. 
VALUE LABELS case 0 'Control' 1 'Case'/ 
     sex 1 'Female' 2 'Male'. 
EXECUTE. 
** A 1:4 ratio *.
FREQUENCIES VARIABLES =case.

** Your posted command -- fails for me **.
*FUZZY BY=age sex supplierid=supplier newdemanderidvar=sid group=case.
** The command the UI built and pasted **.
FUZZY BY=age sex SUPPLIERID=supplier NEWDEMANDERIDVARS=sid GROUP=case EXACTPRIORITY=FALSE  MATCHGROUPVAR=id 
/OPTIONS SAMPLEWITHREPLACEMENT=FALSE MINIMIZEMEMORY=TRUE SHUFFLE=FALSE.

这篇关于如何用SPSS模糊命令修复案例控制匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆