Stata - 如何复制面板数据的单个值?
我有 100 只基金的净资产值(这是每只基金的总净资产值)。在 Stata 中,我将这 100 只基金中每只基金 200 个月的回报率堆叠在一起(针对面板数据)。我如何复制 100 个净资产值中的每一个乘以 200,并将它们叠加在一起 - Stata 中有没有方法可以做到这一点?
通常我的流程是在 Excel 中创建 100 列,每列有 200 行净资产(因此,如果 Fund1 净资产例如为 1500000,我会将此值复制到 Fund1 列中的 200 个单元格中的每个单元格中)。然后我将其全部复制到 Stata 并使用“stack”命令将它们堆叠起来。这是非常费力的,如果Stata提供了一种不涉及Excel到这种程度的方法,我希望以后避免这种情况。
这就是数据,本质上我需要将每个净资产值复制 200 次并堆叠。所以,你可以想象 9578780 堆叠了 200 次(相同的值),然后在另一个 4695101 的下面堆叠了 200 次 9578780 等等。
I have values of the net assets for 100 funds (it's one value of total net assets per fund). In Stata, I have the returns for each of those 100 funds for 200 months each stacked on top of each other (for panel data). How do I replicate each of the 100 net asset values times 200, and stack them up together - is there a method in Stata to do it?
Normally my process would be to create 100 columns in Excel and each column would have 200 rows of net assets (so if fund1 net assets are e.g. 1500000, I would copy this value into each of the 200 cells in a fund1 column). Then I would copy all of it to Stata and use 'stack' command to stack them up. It is very laborious and I want to avoid it in future if Stata offers a method that doesn’t involve Excel to this extent.
This is the data and essentially and I need each net asset value to be copied 200 times and stacked. So, you can imagine 9578780 stacked 200 times (same value) and then below another one 4695101 stacked 200 times under 9578780 and so on.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
听起来你想要
expand
命令:Sounds like you want the
expand
command: