SPSS的滞后功能

发布于 2025-01-17 15:15:03 字数 1192 浏览 4 评论 0原文

对于我的硕士论文,我必须使用数据库来制作逻辑回归模型。我的模型的变量之一是新闻,如果公司在给定年内必须发布负净收入(坏消息),则该变量应等于1,该变量属于本研究的时间段( 2017年,2018年和2019年),虽然它在前一年仍然有阳性的净收入(好消息)。否则,虚拟等于0。 现在,我的教授说,当公司在三年中的净收入负数为负时,我必须做一个与一个相同的假人,否则。我明白的那部分。但是后来她还说,我必须使用滞后功能,以找出公司在净收入负收入前一年的净收入阳性。那部分我不明白。我真的不明白如何在SPSS的帮助下做到这一点。 在下面,您可以找到我必须使用的一小部分数据。

Company's number   Year        Net income       Dummy(net income negative)

      899999256    2017          222884,00                    0

      899999256    2018          237387,00                    0

      899999256    2019          314501,00                    0

      899998959    2017          -22414,00                    1

      899998959    2018          -10834,00                    1

      899998959    2019            -365,00                    1

      899993714    2017             453,00                    0

      899993714    2018             152,00                    0

      899993714    2019             -178,00                   1

在这种情况下,第一公司和两个将获得最终的虚拟变量(新闻)为0。但是,第三公司将获得最终假人,因为他们在2018年获得净收入阳性,而2019年的净收入为负。

现在我必须对于超过1.7万公司,这样做,因此拥有语法代码将使这更容易,这就是为什么我向大家寻求帮助的原因。

先感谢您!

我在网上查看如何执行滞后功能,但是这些解决方案都没有真正解决我的问题。我希望你们中的一个能帮助我:)

For my master's thesis I have to work with a database in order to make a logistic regression model. One of the variables of my model is NEWS, This should be a dummy variable that is equal to 1 if a company had to publish a negative net income (bad news) in a given year, which belongs to the time period of this study (2017, 2018 and 2019), while it still had a positive net income the year before (good news). The dummy is equal to 0 otherwise.
Now my professor said that I had to make a dummy that is equal to one when a company had a negative net income during one of the three years, O otherwise. That part I understand. But then she also said that I had to use a LAG function in order to find out if the company had a positive net income the year before the negative net income. And that part I don't understand. I don't really understand how i should do this with the help of SPSS.
Below you can find a small part of the data I have to work with.

Company's number   Year        Net income       Dummy(net income negative)

      899999256    2017          222884,00                    0

      899999256    2018          237387,00                    0

      899999256    2019          314501,00                    0

      899998959    2017          -22414,00                    1

      899998959    2018          -10834,00                    1

      899998959    2019            -365,00                    1

      899993714    2017             453,00                    0

      899993714    2018             152,00                    0

      899993714    2019             -178,00                   1

In this case company one and two would get a final dummy variable (NEWS) of 0. But company three would get a final dummy of one as they had a positive net income in 2018 and a negative net income in 2019.

Now I have to do this for more than 170 thousand companies so having a syntax code for this would make this much easier and that is why I ask you guys for your help.

Thank you in advance!

I looked online how to do a LAG function but none of those solutions really solved my problem. I hope one of you can help me :)

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

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

发布评论

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

评论(1

温柔戏命师 2025-01-24 15:15:03

以下代码将使用lag功能来标记同一公司的净收入负数,而前一年的净收入为正值:

sort cases by CompanyNumber Year.
compute dummy=0.
if company=lag(company) and NetIncome<0 and lag(NetIncome)>0 dummy=1.
exe.

The following code will use the lag function to mark the years where the same company had a negative net income while the previous year it had a positive one:

sort cases by CompanyNumber Year.
compute dummy=0.
if company=lag(company) and NetIncome<0 and lag(NetIncome)>0 dummy=1.
exe.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文