Stata如何绘制马赛克图?
马赛克图(Marimekko Chart),(也称为镶嵌图和比例堆叠条形图)可视为具有附加轴的常规堆叠图表。这允许我们创建同时具有百分比轴和总轴的图表,使用面积来表示每个细分的总数。这就是我们说的“宽度有意义的百分比堆积柱形图”。 目前并没有通用Stata软件包可以绘制马赛克图,为此维也纳经济大学(Vi...
with Stata
马赛克图(Marimekko Chart),(也称为镶嵌图和比例堆叠条形图)可视为具有附加轴的常规堆叠图表。这允许我们创建同时具有百分比轴和总轴的图表,使用面积来表示每个细分的总数。这就是我们说的“宽度有意义的百分比堆积柱形图”。 目前并没有通用Stata软件包可以绘制马赛克图,为此维也纳经济大学(Vi...
Stata14开始支持Unicode字符,变量、标签、注释及变量值均可以为中文(日韩德等等)了。之后版本若直接读取Stata13及之前的文件( .do 文件和.dta 文件一般为 gbk 或更广泛的gb18030 编码)会显示乱码,影响使用,Stata提供了unicode命令进行转化,简单介绍如下。 使用 Stata 13 及早期版本保存的 d...
上一篇我们解决了如何计算字符变量中特定字符的数量,但有时候写循环,还需要知道字符变量中唯一的单词(unique and distinct words)数量。 读取实例数据,Stata代码如下: * Example generated by -dataex-. For more info, type help dataex clear input group str25 soft total 1 "Stata" 1 1 "...
有没有什么办法计数字符串中的空格数量?字符串首尾都没有空格, 比如 : "a b" 这其中有1个空格,"a b c" 这其中有2个空格。 读取演示数据,Stata命令如下: * Example generated by -dataex-. For more info, type help dataex clear input str15 var1 "a" "a b" "a b c d" "a b c d e f" "a b c ...
Stata 图形模板(schemes)用来定义图形的格式,默认是s2color。 获取所有本机上安装的所有Stata图形模板,Stata命令如下: graph query, schemes 读取演示数据,Stata命令如下: sysuse uslifeexp 选择需要预览的Stata图形模板,如Stata自带的s2color、s2mono、s2manual、sj和economist,Stata命令...
绘制上图的Stata代码如下: sysuse auto, clear reg price ibn.foreign * Test if take up if the same across positive opportunity cost levels, then * create and format local to add to the graph as text test 1.foreign == 0.foreign local pval : di %5.3f `r(p)' local pval = trim("`pva...
绘制上图的Stata代码如下: ** Master file for results replication. ** Please note that tables will be produced in "raw" form and require manual recombination and/or formatting to match the finished tables. * Load adofiles * These files are created by the authors for the purpose...
绘制上图的Stata代码如下: * Maps displaying levels of a variable * ------------------------------------------------------------------------------ * Packages * ------------------------------------------------------------------------------ ssc install spmap ssc install shp2dta *...
绘制上图的Stata代码如下: * FIGURE: Line graph with uncluttered scheme * Load built-in data sysuse uslifeexp * Change scheme: scheme needs to be manually installed. Instruction on how * to this can be found in https://gray.kimbrough.info/uncluttered-stata-graphs/ set scheme un...
绘制上图的Stata代码如下: * FIGURE: Line graph with plottig scheme * Install user-written graph scheme ssc install blindschemes, replace * Select graph scheme (similar to R's ggplot2) set scheme plottig * Load built-in data sysuse sp500, clear * Create graph: show time series ...