楼主: zhaoq1339
47910 9

[数据管理求助] stata补充缺失值方法 [推广有奖]

  • 0关注
  • 0粉丝

高中生

5%

还不是VIP/贵宾

-

威望
0
论坛币
1 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
319 点
帖子
11
精华
0
在线时间
30 小时
注册时间
2009-5-26
最后登录
2014-7-15

楼主
zhaoq1339 发表于 2013-3-20 19:27:28 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
求教: 我的样本是世界上所有国家的银行11年的数据,指标主要是资产,负债,  边际利息率, 成本费用率, 还有宏观变量 gdp  m2 等等,   但是这些数据中有缺失值, 我想用  mi  impute 补上, 请问用哪一种方法补比较好, 是 univariate 的还是multivariate的方法? 具体里面是用哪种方法呢?谢谢各位!

二维码

扫码加我 拉你入群

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

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

关键词:Stata tata 缺失值 Multivariate multivariat 利息率 国家 成本 样本

沙发
肖童 发表于 2013-3-20 20:09:58
请问楼主,怎样用stata 补充数据中的缺失值呀?我找的月度数据中,每一年的第一个月的数据都没有,这种情况怎么处理?谢啦

藤椅
zhaoq1339 发表于 2013-3-20 20:19:25
我也想问怎么补充缺失值啊?  如果你别的变量没有缺失值的话,有一个mi程序,处理缺失值的。

板凳
luluwarm 发表于 2013-4-28 18:44:28
同求
安静从容

报纸
平军 在职认证  学生认证  发表于 2013-5-2 23:28:25 来自手机
help mvencode
已有 1 人评分经验 热心指数 收起 理由
SpencerMeng + 60 + 1 热心帮助其他会员

总评分: 经验 + 60  热心指数 + 1   查看全部评分

地板
yulanheshang 发表于 2014-11-26 10:48:13
没太明白mi impute怎么用。。。。

7
110031037 在职认证  发表于 2015-6-23 22:42:39
平军 发表于 2013-5-2 23:28
help mvencode
help mvencode, help mvdecode                       dialogs:  mvencode  mvdecode
-------------------------------------------------------------------------------

Title

    [D] mvencode -- Change missing values to numeric values and vice versa


Syntax

    Change missing values to numeric values

        mvencode varlist [if] [in], mv(#|mvc=# [\ mvc=#...] [\ else=#])
                  [override]


    Change numeric values to missing values

        mvdecode varlist [if] [in], mv(numlist | numlist=mvc
                  [\ numlist=mvc...])


    where mvc is one of .|.a|.b|...|.z


Menu

    mvencode

        Data > Create or change data > Other variable-transformation commands
            > Change missing values to numeric

    mvdecode

        Data > Create or change data > Other variable-transformation commands
            > Change numeric values to missing


Description

    mvencode changes missing values in the specified varlist to numeric
    values.

    mvdecode changes occurrences of a numlist in the specified varlist to a
    missing-value code.

    Missing-value codes may be sysmiss (.) and the extended missing-value
    codes .a, .b, ..., .z.

    String variables in varlist are ignored.


Options

        +------+
    ----+ Main +-------------------------------------------------------------

    mv(#|mvc=# [\ mvc=#...] [\ else=#]) is required and specifies the numeric
        values to which the missing values are to be changed.

        mv(#) specifies that all types of missing values be changed to #.

        mv(mvc=#) specifies that occurrences of missing-value code mvc be
        changed to #.  Multiple transformation rules may be specified,
        separated by a backward slash (\).  The list may be terminated by the
        special rule else=#, specifying that all types of missing values not
        yet transformed be set to #.

        Examples: mv(9), mv(.=99\.a=98\.b=97), mv(.=99\else=98)

    mv(numlist | numlist=mvc [\ numlist=mvc...]) is required and specifies
        the numeric values that are to be changed to missing values.

        mv(numlist=mvc) specifies that the values in numlist be changed into
        missing-value code mvc.  Multiple transformation rules may be
        specified, separated by a backward slash (\).  See [[U]] 11.1.8
        numlist for the syntax of a numlist.

        Examples: mv(9), mv(99=.\98=.a\97=.b), mv(99=.\100/999=.a)

    override specifies the protection provided by mvencode be overridden.
        Without this option, mvencode refuses to make the requested change if
        any of the numeric values are already used in the data.


Examples

    ---------------------------------------------------------------------------
    Setup
        . sysuse auto

    Translate missing values in the data to 999
        . mvencode _all, mv(999)

    Change 999 values back to missing values
        . mvdecode _all, mv(999)

    List the data
        . list rep78 if rep78 == .

    Set rep78 to 999 in observation 3
        . replace rep78 = 999 in 3

    Try to translate missing values in the data to 999
        . mvencode _all, mv(999)

    Force the translation of missing values in the data to 999
        . mvencode _all, mv(999) override

    ---------------------------------------------------------------------------
    Setup
        . sysuse auto, clear

    List the data
        . list rep78 foreign if rep78 == .

    Translate missing values for rep78 to 998 if foreign is Domestic and
    translate to 999 if foreign is Foreign
        . mvencode rep78 if foreign == 0, mv(998)
        . mvencode rep78 if foreign == 1, mv(999)

    List the data
        . list rep78 foreign if rep78 > 900

    For rep78, translate 998 to . and 999 to .a
        . mvdecode rep78, mv(998=. \ 999=.a)

    List the data
        . list rep78 foreign if rep78 >= .
    ---------------------------------------------------------------------------


Also see

    Manual:  [D] mvencode

      Help:  [D] generate, [D] recode

8
likuntian 学生认证  发表于 2017-8-31 13:23:40
请问楼主解决这个问题了吗

9
霍仕鑫 在职认证  发表于 2020-4-13 22:11:49
感谢感谢!

10
仙女爱学习 学生认证  发表于 2020-9-27 12:01:55
霍仕鑫 发表于 2020-4-13 22:11
感谢感谢!
您好,我想问一下您会用这个嘛

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

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2025-12-31 05:48