SPSS和SAS之间的可变名称不兼容

发布于 2025-01-28 05:14:22 字数 212 浏览 2 评论 0原文

我将SPSS(.SAV文件)导入SAS。其中几个变量没有显示出来,因为它们被命名为诸如“变量___ 1.1”时,当我尝试将某些变量保持在数据步骤中时,我会遇到错误,因为这些变量会造成错误,因为SAS误解了'。

有没有人以前遇到过此事或知道它的方法?

我可以在.sas7bdat文件中看到问题变量及其值,因此导入的数据,我只需要找到一种更改变量名称的方法,以便我可以将其包含在报告中。

I imported an SPSS (.sav file) into SAS. Several of the variables are not showing up as they are named things like 'variable___1.1' When i try to KEEP certain variables in a data step, I get an error because these variables create an error as SAS misinterprets the '.'

Has anyone encountered this before or know a way around it?

I can see the problem variables and their values in the .sas7bdat file, so the data imported, I just need to find a way to change the variable name so I can include it in the report.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

瀞厅☆埖开 2025-02-04 05:14:22

您使用name字面符号,'variable1_1'n在代码中,例如

rename 'variable___1.1'n = variable1_1; 

或设置此选项并重新输入数据,以便获得更好的名称。

option validvarname=v7; 

这将告诉SAS使用更简单的变量名称导入数据。请注意,我不确定这是变量名称中的两个下降或三个或四个。

You use name literal notation, 'variable1_1'n in your code, e.g.

rename 'variable___1.1'n = variable1_1; 

Or set this option and reimport your data so that you get better names.

option validvarname=v7; 

That will tell SAS to import the data with simpler variable names. Note that I'm not sure if that's two underscores or three or four in the variable name....guessing at 3.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文