stata中有没有重命名第二个重复数据的命令?
我有一个包含三个变量的数据列表:ADDRESS、FOODCODE 和 Gr,其中包含 1752 个家庭地址、他们消耗的食物类型以及按克计算的食物量。 这些数据有重复的记录,例如我有两个相似的地址,具有相似的食物代码,但克数不同。 现在我想在stata中将第二个相似地址重命名为新地址。
input double Address int(foodcode gr)
12401295014 11111 4000
12401295014 11111 10000
12501308608 11112 20000
12501313708 11112 10000
11701202105 11115 5000
11701202105 11115 10000
end
I have a list of data with three variable, ADDRESS, FOODCODE and Gr, that consist 1752 household addresses and type of foods they consumed and the amount of food by gram.
these data have duplicated record, for example I have two similar address, with similar foodcode, but different gram.
Now I want to rename the second similar address to a new address in stata.
input double Address int(foodcode gr)
12401295014 11111 4000
12401295014 11111 10000
12501308608 11112 20000
12501313708 11112 10000
11701202105 11115 5000
11701202105 11115 10000
end
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这对于重命名来说不是问题,它是关于重命名变量,与更改数据无关。尽管您没有要求,但设置一个新变量可能会很有用。
更改
address
的值以便同一家庭获得不同的值可能只会使分析变得更加困难。This isn't a problem for
rename
, which is about renaming variables, and nothing to do with changing the data otherwise. Although you don't ask for it, it might be useful for you to set up a new variableChanging the values of
address
so that the same household gets different values is likely only to make analysis more difficult.