【问题标题】:Joining variables with keyvariable in spss在spss中使用keyvariable连接变量
【发布时间】:2017-06-01 16:11:57
【问题描述】:

我想用一个重叠的键变量连接两个数据集。我只想要数据集 1 中的人的数据,他们的 ID 在数据集 1 中也有提及。这是我的代码:

STAR JOIN 
  /SELECT  t0.var1, t0.var2, t1.lfdn, t1.var4, 
    t1.tester, t1.dispcode, t1.lastpage, t1.quality, t1.duration, t1.E1 
  /FROM * AS t0 
  /JOIN 'dataset2.sav' AS t1 
    ON t0.p_0001=t1.p_0001 
  /OUTFILE FILE=*.

当我合并它们时,我得到了添加到文件中的变量名,而不是变量中的数据。

【问题讨论】:

    标签: statistics spss spss-modeler


    【解决方案1】:

    尝试使用match files 而不是star join

    你的命令应该是这样的:

    *first make sure both files are sorted by `p_0001`.
    match files /file=* /tab='dataset2.sav'/by p_0001/keep var1 var2 var3.
    

    使用keep(或drop)子命令在最终数据集中选择您需要的变量。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-08-12
      • 2017-03-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-07-27
      • 1970-01-01
      相关资源
      最近更新 更多