0

从事将 SPSS 调查数据文件导出到 MySQL 数据库的项目。虽然通过 ODBC 的实际导入很好,但我遇到了如何处理数据中的标签的两难境地。例如,我的每个问题的 SPSS 文件都有一个数字作为与该变量的描述性标签相对应的数据。

我希望能够将两个值、数字选择和答案选项都保存到数据库中 - 有没有办法将两者链接起来,或者我需要制作一些更复杂的数据库表和关系来保存所有内容.

4

2 回答 2

2

我认为您指的是价值标签与价值。通常它是要导出的值。您可以将标签集导出到不同的数据库表并通过 SQL 链接它们。

一个更简单的解决方案是为每个要为其标签保留标签的变量创建一个并行变量。为此,请使用字符串 x_label(a120) 之类的内容。计算 x_label = valuelabel(x)。

如果你有很多这些变量,你可以把这个逻辑放在带有向量的 DO REPEAT 中。

HTH,乔恩·派克

于 2011-12-16T02:45:44.513 回答
1

You can duplicate the variables in SPSS and then remove the labels from the new variables. Is this what you want?

Relationships simply for labels seems to be overkill. If you have twenty questions and they used different labels in their items, the relationships can be too complicated.

On the other hand, if you have a table for questions, you can put labels in that table. For example:

ID Statement Item1 Item2 Item3 Item4

But, if they all use the same labels (e.g. agree, disagree, ...), then it is not necessary to do that.

于 2011-12-15T23:17:04.573 回答