- 阅读权限
- 255
- 威望
- 0 级
- 论坛币
- 14446 个
- 通用积分
- 1962.3850
- 学术水平
- 1119 点
- 热心指数
- 1167 点
- 信用等级
- 1061 点
- 经验
- 8523 点
- 帖子
- 1629
- 精华
- 1
- 在线时间
- 2492 小时
- 注册时间
- 2010-10-10
- 最后登录
- 2025-12-19
|
- // Text that varies in size due to a calculated factor
-
- clear programs
-
- *--------------- begin example ---------------------
- program s
-
- sysuse auto, clear
- tempname hdle
- tempfile info
- postfile `hdle' str20 variable missings using `info'
-
- qui ds, has(type numeric)
-
- qui foreach var in `r(varlist)'{
- /*want more missings
- to make this interesting */
- replace `var'=. if runiform()<0.1
- qui count if `var'==.
- post `hdle' ("`var'") (r(N))
- }
-
- postclose `hdle'
-
- use `info', clear
- gen number=_n
- list, noobs
- gen x = 1
-
- sum missings, meanonly
- gen factor = missings/r(mean)
- levelsof variable, local(aa)
-
- local a=1
-
- foreach i of local aa {
-
- local f = factor[`a'
- local txt `"`txt' text(`a' 1 "`i'", size(*`f'))"'
- capture `++a'
- }
-
- scatter number x, msymbol(i) ///
- xtitle("") xscale(off) ///
- ytitle("") yscale(off) ///
- plotregion(lstyle(none)) ///
- `txt'
- *----------------- end example -----------------------------
- end
-
- s //calls program "s" above
复制代码
|
-
总评分: 经验 + 50
论坛币 + 20
学术水平 + 1
热心指数 + 1
信用等级 + 1
查看全部评分
|