全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
12656 9
2017-01-02
悬赏 2000 个论坛币 已解决
mrtab 是stata外部命令关于 多项选择题的统计程序。
mrgraph 是stata外部命令关于 多项选择题的作图程序。这个需要 这样安装 ssc install mrtab
程序:use http://fmwww.bc.edu/RePEc/bocode/d/drugs.dta  //数据使用
           mrgraph bar crime1-crime5, include response(2 3) sort ///
           width(15) title(Criminal experiences (as a victim)) ///
           ylabel(,angle(0))  //作图  如图 `"Criminal experiences (as a victim)"'
问题是如何修改x轴上  use a  weapon  against   blackmail  sexual harassment rape  robbery  including drug theft  hit someone  这些标签的字体大小。
这些字体是可以编辑的,但是我想知道如何通过命令进行修改。请各位大神请写出命令。谢谢了。
求助,求助,求助,求助


参考,一般的条形图的修改轴上的命令可见https://bbs.pinggu.org/thread-5040035-1-1.html

Graph.png

原图尺寸 72.4 KB

Graph.png

最佳答案

夏目贵志 查看完整内容

我仔细看了下你这个程序。程序本身已经提供这个选项了。可能你一开始没注意。用下面这个命令就可以把字体变小了 mrgraph hbar crime1-crime5, include response(2 3) sort width(15) title(Criminal experiences (as a victim)) ylabel(,angle(0)) oversubopts(label(labsize(vsmall))) 相关的选项是命令里最后一部分的内容。
二维码

扫码加我 拉你入群

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

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

全部回复
2017-1-2 00:36:59
我仔细看了下你这个程序。程序本身已经提供这个选项了。可能你一开始没注意。用下面这个命令就可以把字体变小了
mrgraph hbar crime1-crime5, include response(2 3) sort width(15) title(Criminal experiences (as a victim)) ylabel(,angle(0)) oversubopts(label(labsize(vsmall)))
相关的选项是命令里最后一部分的内容。
二维码

扫码加我 拉你入群

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

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

2017-1-2 00:38:08
use http://fmwww.bc.edu/RePEc/bocode/d/drugs.dta
mrgraph bar crime1-crime5, include response(2 3) sort ///
           width(15) title(Criminal experiences (as a victim)) ///
           ylabel(,angle(0))
二维码

扫码加我 拉你入群

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

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

2017-1-2 01:53:45
这个一开始我说的不对。请看我最新一个回帖。
二维码

扫码加我 拉你入群

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

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

2017-1-2 21:32:17
夏目贵志 发表于 2017-1-2 01:53
这个需要修改一下它的程序。我暂时没时间具体帮你改,但是可以提供一个思路。在主程序加入一个新的option。 ...
help 后
mrgraph { bar | hbar | dot | tab } varlist [weight] [if exp] [in range] [, { response(numlist) | condition(exp) } poly countall include includemissing casewise sort[(#)] descending by(varname[, by_subopts]) stat(statname)
   rtotal ctotal nopercent nolabel addval[(string)] width(#) height(#) oversubopts(over_subopts) graph_options ]
    where by_subopts is
        { inboard | outboard [ over_subopts ] | separate [ suboptions ] }
    and statname is
        { freq | column | row | cell | rcolumn | rcell }Description
    mrgraph may be used to produce graphs of multiple response distributions. Please read help mrtab before using mrgraph. The syntaxes mrgraph bar, mrgraph hbar and mrgraph dot are specified to indicate use of graph bar, graph hbar
    and graph dot respectively. The size (height or length) of the bars or position of the dots in the graph corresponds to the frequencies (or, optionally, proportions) of the response categories. mrgraph tab produces table plots in
    the manner of Nick Cox's tabplot (Cox 2004). mrgraph is implemented as a wrapper for mrtab followed by _mrsvmat and graph.
Options
    addval[(string)] specifies that labels and values (or variable names in the case of the indicator mode) are used to mark the responses in the graph. The values and labels will be separated by string if specified or by a blank
        otherwise (use quotes, if the desired delimiter has leading and/or trailing blanks, i.e. addval(": ")). If the addval option is not specified, then labels are used exclusively.  However, if no labels are available, values are
        used and addval will have no effect. Furthermore, addval will have no effect if the response variables are string.
    by(varname[, by_subopts])} draws the conditional distributions of responses for the categories of varname. The by-variable may be string or numeric. The by_subopts control the grouping of the results in the graph if the graph
        type is mrgraph bar, mrgraph hbar, or mrgraph dot. Possible specifications are:
        inboard

            The categories of the by-variable are grouped within the categories of the multiple response variables. This is the default.

        outboard [ over_subopts ]

            The categories of the multiple response variables are grouped within the categories of the by-variable. The separation of the by-groups is implemented as an additional over statement in the internal graph call. Thus,
            over_subopts may be specified. See help graph bar and help graph dot.

        separate [ suboptions ]

            For each category of the by-variable a separate plot is drawn within a single graph. This conforms to the default behavior of the by option in Stata's graph commands (which, however, is not the default in mrgraph). See
            help by_option for details on the suboptions.

    casewise specifies that cases with missing values for at least one of the response variables should be excluded listwise.

    condition(exp) is an alternative to the response() option. See help mrtab for details on this option.

    countall requests that repeated identical responses be added up.

    ctotal specifies that column totals be reported.

    descending specifies that the sort order be descending. The default is to sort in ascending order. This is only relevant if sort is specified.

    height(#) controls the amount of available graph space taken up by bars in the table plot. This option is only relevant if the graph type is mrgraph tab. The default is 0.8.

    include specifies that observations composed of zero responses be treated as valid. See help mrtab for details on this option.

    includemissing is an enhancement to include and specifies that cases be treated as valid even if all response variables are missing. See help mrtab for details on this option.

    nolabel specifies that labels be ignored.

    nopercent specifies that relative frequencies be formatted as proportions (.271) instead of percentages (27.1).

    oversubopts(over_subopts) may be used to pass suboptions through to the over option which is applied by mrgraph in the internal call of the graph command. This is only relevant for the graph types mrgraph bar, mrgraph hbar, and
        mrgraph dot. For further explanations on the over option and its suboptions see help graph bar and graph dot. Do not use the sort suboption; use mrgraph's own sort option instead (see below).

    poly specifies that the responses are stored in polytomous mode. See help mrtab for details on this option.

    response(numlist) specifies the (range of) response values. See help mrtab for details on this option.

    rtotal specifies that row totals be reported.

    sort draws the categories in ascending order of frequency. If by is specified, the sorting will correspond to the totals over all groups unless a reference group is specified in parentheses. That is, sort(1) will sort in order of
        the frequencies in the first by-group, sort(2) in order of the frequencies in the second by-group, and so on.  Specify descending to sort in descending order.

    stat(statname) determines the statistic which the graph be based on. statname is either freq, if raw frequencies be used, or column (base: column total of observations), row (base: row total), cell (base: grand total of valid
        observations), rcolumn (base:  column total of responses), or rcell (base: grand total of responses), if relative frequencies be used. stat(freq) is the default.

    width(#) specifies the maximum width (number of chars) used to display the labels of the responses. Labels that are too wide are wrapped. Note that the single words in the labels will not be broken. If no width is specified,
        labels are not wrapped.

请问大人如何添加命令,给予提示。
我把使用 图形修改的进行了截图。请版主给予帮忙。

附件列表
流程图.png

原图尺寸 259.57 KB

流程图.png

二维码

扫码加我 拉你入群

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

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

2017-1-2 21:47:47
欢饮提供建议。
二维码

扫码加我 拉你入群

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

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

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

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