全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
18403 5
2016-10-24
小白一枚
请问stata 中use 后面跟clear 和replace 什么区别
二维码

扫码加我 拉你入群

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

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

全部回复
2016-10-24 08:58:43
clear 是清空已有数据;
replace是替代已有数据。
clear 一般接在use后面,但replace基本接在save后面。
二维码

扫码加我 拉你入群

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

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

2016-10-24 09:11:40
j610f2012 发表于 2016-10-24 08:58
clear 是清空已有数据;
replace是替代已有数据。
clear 一般接在use后面,但replace基本接在save后面。
感谢感谢
二维码

扫码加我 拉你入群

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

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

2016-10-24 09:17:45
看帮助解释
use 后面也没有replace参数啊


Title

    [D] use -- Load Stata dataset
Syntax
    Load Stata-format dataset
        use filename [, clear nolabel]

    Load subset of Stata-format dataset
        use [varlist] [if] [in] using filename [, clear nolabel]

Menu
    File > Open...
Description
    use loads into memory a Stata-format dataset previously saved by save.  If filename is specified
    without an extension, .dta is assumed.  If your filename contains embedded spaces, remember to
    enclose it in double quotes.

    In the second syntax for use, a subset of the data may be read.
Options
    clear specifies that it is okay to replace the data in memory, even though the current data have not been saved to disk.

    nolabel prevents value labels in the saved data from being loaded.  It is unlikely that you will ever want to specify this option.

Examples
    . use http://www.stata-press.com/data/r13/auto
    . replace rep78 = 3 in 12

    . use http://www.stata-press.com/data/r13/auto, clear
    . keep make price mpg rep78 weight foreign
    . save myauto

    . use make rep78 foreign using myauto
    . describe

    . use if foreign == 0 using myauto
    . tab foreign, nolabel
    . use using myauto if foreign==1
    . tab foreign, nolabel


二维码

扫码加我 拉你入群

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

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

2016-10-25 09:22:01
那GENERATE 和REPLACE 如何结合用啊
二维码

扫码加我 拉你入群

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

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

2016-10-25 10:18:58
newfei188 发表于 2016-10-25 09:22
那GENERATE 和REPLACE 如何结合用啊
先drop再gen,或者直接用replace。
二维码

扫码加我 拉你入群

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

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

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

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