楼主: 匿名
4271 16

[Panel Data专题] 外部命令的使用 [推广有奖]

匿名网友
11
匿名网友  发表于 2010-6-28 11:25:10 |坛友微信交流群
外部命令的调研,每次使用之前都得输入一下命令才能使用,比如pwcorr_a命令,第一次使用完之后关闭stata,在第二次再次使用stata时,又得输入一下三个命令才能重新调用您提供的外部命令,而且使用help命令也找不到外部命令,这是什么原因呀?sysdir set PLUS "D:\stata10\ado\plus"
sysdir set PERSONAL "D:\stata10\ado\personal"
sysdir set OLDPLACE "c:\ado"

使用道具

12
arlionn 在职认证  发表于 2010-6-28 14:41:02 |只看作者 |坛友微信交流群
你可以把如下命令贴到一个空白的 do file 中,保存为 profile.do ,放置于 D:\stata10 文件夹下,然后重新启动 stata 即可。


set type double
set memory 50m
set matsize 2000
set more off,perma
set scrollbufsize 300000

adopath + "D:\stata10\ado\personal"

local fn = subinstr("`c(current_time)'",":","",2)
local fn1 = subinstr("`c(current_date)'"," ","",3)
log using d:\stata10\do\s`fn1'`fn'.log, text replace
cmdlog using d:\stata10\do\c`fn1'`fn'.log, replace


sysdir set PLUS "D:\stata10\ado\plus"
sysdir set OLDPLACE "c:\ado"
sysdir set PERSONAL "D:\stata10\ado\personal"

cd d:\stata10\ado\personal

使用道具

匿名网友
13
匿名网友  发表于 2010-6-28 17:01:07 |坛友微信交流群
好像还是不行!不知道什么原因

使用道具

14
arlionn 在职认证  发表于 2010-6-28 20:09:40 |只看作者 |坛友微信交流群
如果设定无误,重新打开stata时会显示:

running D:\stata10\profile.do ...


进一步输入 sysdir 命令,会显示

. sysdir
   STATA:  D:\stata10\
UPDATES:  D:\stata10\ado\updates\
    BASE:  D:\stata10\ado\base\
    SITE:  D:\stata10\ado\site\
    PLUS:  D:\stata10\ado\plus\
PERSONAL:  D:\stata10\ado\personal\
OLDPLACE:  D:\ado\


我的 profile.do 文件设定如下:
set type double
set memory 50m
set matsize 2000
set more off,perma
set scrollbufsize 300000

adopath + "D:\stata10\ado\personal"
adopath + "D:\stata10\ado\personal\_Myado"
adopath + "D:\stata10\ado\personal\update1"
adopath + "D:\stata10\ado\personal\update_old"
adopath + "D:\stata10\ado\personal\invt"

local fn = subinstr("`c(current_time)'",":","",2)
local fn1 = subinstr("`c(current_date)'"," ","",3)
log using d:\stata10\do\s`fn1'`fn'.log, text replace
cmdlog using d:\stata10\do\c`fn1'`fn'.log, replace


sysdir set PLUS "D:\stata10\ado\plus"
sysdir set OLDPLACE "D:\ado"
sysdir set PERSONAL "D:\stata10\ado\personal"

cd d:\stata10\ado\personal

doedit

使用道具

15
arlionn 在职认证  发表于 2010-6-28 20:10:58 |只看作者 |坛友微信交流群
另外,你可以吧 pwcorr_a 命令放置于 D:\stata10\ado\plus\p 文件夹下,
亦可放置于 D:\stata10\ado\base\p 文件夹下。

建议采用第一种方式。

使用道具

匿名网友
16
匿名网友  发表于 2010-6-28 22:31:43 |坛友微信交流群
sysdir
   STATA:  D:\stata10\
UPDATES:  D:\stata10\ado\updates\
    BASE:  D:\stata10\ado\base\
    SITE:  D:\stata10\ado\site\
    PLUS:  c:\ado\plus\
PERSONAL:  c:\ado\personal\
OLDPLACE:  c:\ado\
后三项我的在C盘目录下,不是在D盘

使用道具

17
arlionn 在职认证  发表于 2010-6-29 15:20:46 |只看作者 |坛友微信交流群
不知你是否按照第 12 楼的方法制作 profile.do 文件,并在你的stata中运新?
如果运行正确的话,应该不会出现楼上的问题。

使用道具

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

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

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

GMT+8, 2024-5-14 02:58