楼主: omega1860
5543 7

如何比较一个stata数据里的两条观测值是否完全一样? [推广有奖]

  • 0关注
  • 0粉丝

高中生

27%

还不是VIP/贵宾

-

威望
0
论坛币
543 个
通用积分
0.6000
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
258 点
帖子
8
精华
0
在线时间
36 小时
注册时间
2006-4-16
最后登录
2023-7-30

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币

如题:

比如reg.dta文件里有obs1和obs2,

变量有name、age等100个,我如何确定obs1和obs2是不是完全一样?

 

 

name

age

cm

Obs1

kid

16

.

Obs2

kid

15

.

拜托了,各位高手!!

[此贴子已经被作者于2007-11-9 15:41:43编辑过]

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:STATA数据 Stata tata 观测值 DTA文件 数据 Stata 观测

沙发
spoonshen 发表于 2007-11-10 03:51:00 |只看作者 |坛友微信交流群
用命令list把它们列出来看一下不就行了?

使用道具

藤椅
cuiboss 发表于 2007-11-14 14:08:00 |只看作者 |坛友微信交流群
在excel中,第一个减第二个,看是否都是0

使用道具

板凳
bookbug 发表于 2007-11-14 15:13:00 |只看作者 |坛友微信交流群

help for cf                                                                            (manual:  [R] cf)
--------------------------------------------------------------------------------------------------------

Compare two datasets

        cf varlist using filename [, verbose ]


Description

cf compares varlist of the data in memory (master data) to the corresponding variables in filename
(using data).  cf returns 0 if the specified variables are identical and 9 if there are any differences.
Only the variable values are compared.  Variable labels, value labels, notes, characteristics, etc. are
not compared.


Options

verbose mentions the result of the comparison variable-by-variable.  If not specified, only differences
    are mentioned.


Examples

        . cf mpg weight displ using mydata

        . cf _all using mydata


Also see

 Manual:  [R] cf
On-line:  help for compare
或者net search compare

你会找到cf的其他版本

cf2 from http://fmwww.bc.edu/RePEc/bocode/c
    'CF2': module to compare two datasets / cf2 is a slight variation of cf to
    list the observations where / differences exist.  Option verbose must be
    specified to obtain / the listing. Like cf, cf2 compares varlist of the
    data in memory / (master data) to the corresponding variables in filename

cf3 from http://fmwww.bc.edu/RePEc/bocode/c
    'CF3': module to compare two datasets / cf3 matches observations by a
    record id variable and lists the / observations where differences exist.
    It compares variables of / the dataset in memory (the 'master' data) to
    the corresponding / variables in a file (the 'using' data).  Only the

[此贴子已经被作者于2007-11-14 15:26:18编辑过]

使用道具

报纸
sungmoo 发表于 2007-11-14 15:26:00 |只看作者 |坛友微信交流群

令两个obs各自形成一个(单obs)数据库,任意打开一个。

cf _all using 另一个数据库的路径, all verbose

使用道具

地板
towntower 发表于 2007-11-15 14:46:00 |只看作者 |坛友微信交流群
点击工具烂,选择data---variable utilities----compare two variables,然后就出结果了。

使用道具

7
cuiboss 发表于 2007-11-16 16:56:00 |只看作者 |坛友微信交流群
6楼是比较两个变量,1楼可能是要比较两次观测是否完全一样吧!

使用道具

8
Linda孙 发表于 2012-3-27 08:33:58 |只看作者 |坛友微信交流群
bookbug 发表于 2007-11-14 15:13
help for cf              &nbsp ...
非常非常感谢,帮了大忙

使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-5-2 13:56