当在自定义表格中进行z测试时,SPSS会将multi response sets与分类变量区别对待。我假设这种行为与响应的重叠有关,但我无法弄清楚如何。
那么,对于多响应集(MRsets),SPSS如何进行z测试?
我的目标是为R中的MRset重现SPSS z-test,但我无法弄清楚SPSS实际上做了什么。通常,SPSS自定义表z测试与
相同prop.test(c(proportion1,proportion2),c(columnSum1,columSum2),"two.sided",correct=F)
但显然与MRset不同。
为清楚起见,请查看此分类与MRset比较。
分类z-test SPSS语法
CTABLES
/VLABELS VARIABLES=splitVar catVar DISPLAY=DEFAULT
/TABLE splitVar [C][COUNT F40.0] BY catVar [C]
/CATEGORIES VARIABLES=splitVar catVar ORDER=A KEY=VALUE EMPTY=EXCLUDE
/COMPARETEST TYPE=PROP ALPHA=0.05 ADJUST=NONE ORIGIN=COLUMN INCLUDEMRSETS=NO CATEGORIES=ALLVISIBLE.
C-D-z测试(第一行)的R再现:http://www.r-fiddle.org/#/fiddle?id=p4gw9ftk
"Categorical var z-test"
"Doing a proportions test for first row (splitVar=1) and columns C and D"
prop.test(c(198,242), c(198+35,242+65), alternative="two.sided", correct=F )
"As we see, there are no significant differences in the proportions on an alpha=0.05 level"
MRset z-test SPSS语法:
CTABLES
/VLABELS VARIABLES=splitVar $MySet DISPLAY=DEFAULT
/TABLE splitVar [C] BY $MySet [C][COUNT F40.0]
/CATEGORIES VARIABLES=splitVar ORDER=A KEY=VALUE EMPTY=EXCLUDE
/CATEGORIES VARIABLES=$MySet EMPTY=INCLUDE
/COMPARETEST TYPE=PROP ALPHA=0.05 ADJUST=NONE ORIGIN=COLUMN INCLUDEMRSETS=YES CATEGORIES=ALLVISIBLE.
C-D-z测试(第一行)的R再现:http://www.r-fiddle.org/#/fiddle?id=GAhnnrv0
"MRset z-test"
"Doing a proportions test for first row (splitVar=1) and columns C and D"
overlap_splitvar1_CD <- 53
overlap_splitvar2_CD <- 9
prop.test(c(198-overlap_splitvar1_CD,242-overlap_splitvar1_CD), c(198+35-overlap_splitvar1_CD-overlap_splitvar2_CD,242+65-overlap_splitvar1_CD-overlap_splitvar2_CD), alternative="two.sided", correct=F )
"As we see, there are still no significant differences in the proportions on an alpha=0.05 level. In contrast, SPSS does detect a difference. Why?"
从MRset R代码中可以看出,即使减去重叠情况也无济于事。也许它与加权或其他东西有关? 非常感谢您的想法。