Stata 15 help for _get_gropts

Title

[G-2] _get_gropts -- Parsing tool for graph commands

Syntax

_get_gropts, graphopts(options) [grbyable nobycheck totalallowed missingallowed getbyallowed(namelist) getcombine gettwoway getallowed(namelist)]

Description

_get_gropts is a parsing tool that was written to assist in syntax checking and parsing of commands that generate graphs.

Options

graphopts(options) contains the options to be parsed.

grbyable indicates that the by() option is allowed; see [G-3] by_option. By default, by() is not allowed.

totalallowed indicates that the total option is allowed as an option within the by() option. By default, by(,total) is not allowed.

missingallowed indicates that the missing option is allowed as an option within the by() option. By default, by(,missing) is not allowed.

getbyallowed(namelist) allows for the extraction of specific options that take arguments from the by() option. For each name in namelist, the option name() is placed in s(by_name) like a passthru. By default, all unrecognized options are returned in s(byopts). Option abbreviations are allowed in namelist. All letters in name are converted to lowercase for s(by_name).

This option requires the grbyable option.

nobycheck prevents _get_gropts from checking if options are provided to the by() option, but not a varlist. By default, the by() option requires a varlist.

getcombine checks for the unique options allowed by graph combine. For a complete list of these options, see [G-2] graph combine; also see [G-4] concept: repeated options. All options that take arguments are returned as passthrus according to the syntax documentation. This option may not be combined with gettwoway.

gettwoway checks for the unique options allowed by graph twoway. For a complete list of these options, see [G-3] twoway_options; also see [G-4] concept: repeated options. All options that take arguments are returned as passthrus according to the syntax documentation. This option may not be combined with getcombine.

getallowed(namelist) allows for the extraction of specific options that take arguments. For each name in namelist, the arguments in name() are placed in s(name). By default, all unrecognized options are returned in s(graphopts). Option abbreviations are allowed in namelist. All letters in name are converted to lowercase for s(name).

Some official Stata commands that use _get_gropts

The following commands use _get_gropts. See help for

ac, avplot, fracplot, greigen, grmeanby, kdensity, lowess, lroc, lsens, pac, pnorm, qnorm, qqplot, quantile, xchart, xcorr

Examples

. _get_gropts , graphopts(by(for, total) name(gr1) saving(gr1, replace) replace ciopts(m(o)) plot(function y = sin(3*c(pi)*x))) grbyable total getallowed(ciopts plot)

. sreturn list

macros: s(graphopts) : "name(gr1) saving(gr1, replace) replace" s(varlist) : "foreign" s(total) : "total" s(plot) : "function y = sin(3*c(pi)*x)" s(ciopts) : "m(o)"

. _get_gropts , graphopts(by(for, total ti("Title") legend(draw)) name(gr1) saving(gr1, replace) ciopts(m(o)) plot(function y = sin(3*c(pi)*X))) grbyable total getbyallowed(TItle) getcombine getallowed(ciopts plot)

. sreturn list

macros: s(varlist) : "foreign" s(total) : "total" s(by_title) : "title("Title")" s(byopts) : "legend(draw)" s(combineopts) : "name(gr1) saving(gr1, replace)" s(plot) : "function y = sin(3*c(pi)*x)" s(ciopts) : "m(o)"

Stored results

_get_gropts stores the following in s():

Macros s(varlist) varlist from by() s(total) total option from by() s(missing) missing option from by() s(by_name) the name() option from by() s(byopts) rest of the options from by() s(combineopts) the getcombine options s(twowayopts) the gettwoway options s(name) arguments in name() from graphopts() s(graphopts) rest of the options from graphopts()


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index