全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
4752 8
2013-09-25

use http://www.stata-press.com/data/r8/womenwk, clear

generate d = 1

replace  d = 0 if wage == .

heckman wage educ age, select (married children educ age) twostep

heckman wage educ age, select (married children educ age) nolog

*heckman wage educ age, select (d = married children educ age) twostep nolog

*probit d  married children educ age, nolog

predict cndwage, ycond

summarize wage cndwage if wage < .

predict expwage, yexpected

gen wage0 = wage

replace wage0 = 0 if wage >= .

summarize wage0 expwage

这其中的三个空格加点是什么意思啊?都是空缺值或0的意思吗?
二维码

扫码加我 拉你入群

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

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

全部回复
2013-9-25 22:08:24
This answers your question, quoted from http://www.stata.com/help.cgi?missing

replace  d = 0 if wage == .                        
* replace d to 0 if wage equals missing value
summarize wage cndwage if wage < .            
* summarize wage and cndwage when the missing value of wage is excluded
replace wage0 = 0 if wage >= .
* replace wage0 to 0 if wage is missing
               
Quote :
*"        ., the default, which is called the "system missing value" or sysmiss


    and


        .a, .b, .c, ..., .z, which are called the "extended missing values".


    Numeric missing values are represented by large positive values.  The
    ordering is


                all nonmissing numbers < . < .a < .b < ... < .z


    Thus, the expression age > 60 is true if variable age is greater than 60
    or missing.


    To exclude missing values, ask whether the value is less than ".".  For
    instance,


        . list if age > 60 & age < .


    To specify missing values, ask whether the value is greater than or equal
    to ".".  For instance,


        . list if age >=.


    Stata has one string missing value, which is denoted by "" (blank).  "*
二维码

扫码加我 拉你入群

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

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

2013-9-26 18:51:59
Bayesian.var 发表于 2013-9-25 22:08
This answers your question, quoted from http://www.stata.com/help.cgi?missing

replace  d = 0 if w ...
再问下这个大于号、小于号一般怎么区分使用呢?
二维码

扫码加我 拉你入群

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

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

2013-9-26 20:16:59
大于和小于号就按正常的理解来区分,  >大于,<小于,>=大于或者等于,<=小于或者等于

在这里就把缺失值当做一个特例,一个无限足够大的数集,一个正常的数据所不能达到的水平,只有大于等于这个临界(.) 才是缺失值,小于就是正常观测值。
二维码

扫码加我 拉你入群

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

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

2013-9-26 21:28:17
Bayesian.var 发表于 2013-9-26 20:16
大于和小于号就按正常的理解来区分,  >大于,=大于或者等于,
原来这样啊,差不多明白了,stata里的表示有点奇怪,谢谢了
二维码

扫码加我 拉你入群

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

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

2013-9-26 21:51:32
这些就需要看manual里面介绍stata对缺失值的介绍和解释了
二维码

扫码加我 拉你入群

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

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

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群