楼主: 匿名
2986 3

[编程问题求助] 关于stata11命令输入的一个问题 [推广有奖]

匿名网友
楼主
匿名网友  发表于 2013-4-20 17:06:31 |AI写论文
10论坛币
命令如下:
sysuse sp500,clear
gen n=_n
twoway(line open close n in 1/50,sort clpattern(-)),plotregion(margin(zero)) title("twoway line") xtitle("date") ytitle("price") legend(label(1 "open") label(2 "close") order(2 1) ring(0) pos(8)) text(1300 25 "open")
怎样把命令改成:

sysuse sp500,clear
gen n=_n
twoway(line open close n in 1/50,sort clpattern(-))
,
plotregion(margin(zero))
title("twoway line")
xtitle("date")
ytitle("price")
legend(label(1 "open") label(2 "close") order(2 1) ring(0) pos(8))
text(1300 25 "open")
而不改变得出的结果啊?


最佳答案

jonathanjp 查看完整内容

--------------------begin myfile1.do-------------------- #delimit ; sysuse sp500,clear; gen n=_n; twoway(line open close n in 1/50,sort clpattern(-)) , plotregion(margin(zero)) title("twoway line") xtitle("date") ytitle("price") legend(label(1 "open") label(2 "close") order(2 1) ring(0) pos(8)) text(1300 25 "open") ; #delimit cr --------------------end myfile1.do---------------- ...
关键词:Stata11 Stata 命令输入 tata Pattern legend close price title

沙发
jonathanjp 发表于 2013-4-20 17:06:32
--------------------begin myfile1.do--------------------
#delimit ;
sysuse sp500,clear;
gen n=_n;
twoway(line open close n in 1/50,sort clpattern(-))
,
plotregion(margin(zero))
title("twoway line")
xtitle("date")
ytitle("price")
legend(label(1 "open") label(2 "close") order(2 1) ring(0) pos(8))
text(1300 25 "open")
;
#delimit cr
--------------------end myfile1.do----------------------

Note that the above code can only be used within a .do or .ado file.

For more information, please refer to help delimit..
已有 1 人评分经验 论坛币 学术水平 热心指数 信用等级 收起 理由
Sunknownay + 100 + 10 + 1 + 1 + 1 热心帮助其他会员

总评分: 经验 + 100  论坛币 + 10  学术水平 + 1  热心指数 + 1  信用等级 + 1   查看全部评分

匿名网友
藤椅
匿名网友  发表于 2013-4-20 17:31:38
jonathanjp 发表于 2013-4-20 17:24
--------------------begin myfile1.do--------------------
#delimit ;
sysuse sp500,clear;
原来如此,谢谢啦,不过这不能直接在命令窗口输入吗?

板凳
jonathanjp 发表于 2013-4-20 17:34:32
平军 发表于 2013-4-20 17:31
原来如此,谢谢啦,不过这不能直接在命令窗口输入吗?
在命令窗口直接输入是不行的。

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

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2026-1-9 11:45