自定义表:SPSS如何以不同于分类变量的方式处理多响应集?

时间:2015-07-28 10:05:19

标签: r statistics spss significance hypothesis-test

当在自定义表格中进行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比较。

分类var z-test(根据z-test,C& D列没有不同)

  • 分类数据集(无重叠,3623个案例):Download dataset
  • 分类重叠矩阵(无重叠):enter image description here
  • 分类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.
    
  • 分类z检验输出: enter image description here

  • 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-检验(表中相同的数字,但不同的z检验结果:C& D列的显着差异)

  • MRset数据集(包括重叠,2404个案例):Download dataset
  • MRset重叠矩阵:enter image description here
  • MRset z-test输出:enter image description here
  • 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代码中可以看出,即使减去重叠情况也无济于事。也许它与加权或其他东西有关? 非常感谢您的想法。

可能有用的链接:A Note on Weights and Multiple Response Sets

1 个答案:

答案 0 :(得分:0)

可能是CTABLES可能应用的Bonferroni adjustment 吗?