📄 creturn.hlp
字号:
change with the by-group; {cmd:_N} does.
{pmore}
The advantage of {cmd:c(N)} is in nonexpression contexts. Say that you are
calling a subroutine, {cmd:mysub}, which takes as an argument the number of
observations in the dataset. In that case, you could code
{cmd:local nobs = _N}
{cmd:mysub `nobs'}
or
{cmd:mysub `c(N)'}
{pin2}
The second requires less typing.
{phang}
{cmd:c(k)} returns a numeric scalar equal to the number of variables
in the dataset in memory.
{cmd:c(k)} is equal to {cmd:r(k)} returned by {helpb describe}.
{phang}
{cmd:c(width)} returns a numeric scalar equal to the width, in bytes,
of the dataset in memory.
If you had a dataset with 2 {help int} variables, 3
{help float}s, 1 {help double}, and a {help data types:str20} variable, the
width of the dataset would be 2*2 + 3*4 + 8 + 20 = 44 bytes.
{cmd:c(width)} is equal to {cmd:r(width)} returned by {helpb describe}.
{phang}
{cmd:c(changed)} returns a numeric scalar equal to 0 if the dataset in memory
has not changed since it was last saved and returns 1 otherwise.
{cmd:c(changed)} is equal to {cmd:r(changed)} returned by {helpb describe}.
{phang}
{cmd:c(filename)} returns a string containing the filename last specified with
a {helpb use} or {helpb save}, such as
"{cmd:http://www.stata-press.com/data/r9/auto.dta}". {cmd:c(filename)} is
equal to {cmd:$S_FN}.
{phang}
{cmd:c(filedate)} returns a string containing the date and time the file in
{cmd:c(filename)} was last saved, such as "{cmd:7 Jul 2002 13:51}".
{cmd:c(filedate)} is equal to {cmd:$S_FNDATE}.
{title:Output settings}
{phang}
{cmd:c(more)} returns a string containing "{cmd:on}" or "{cmd:off}"
indicating the current {helpb more:set more} setting.
{phang}
{cmd:c(rmsg)} returns a string containing "{cmd:on}" or "{cmd:off}"
indicating the current {helpb rmsg:set rmsg} setting.
{phang}
{cmd:c(dp)} returns a string containing "{cmd:period}" or "{cmd:comma}"
indicating the current {helpb dp:set dp} setting.
{phang}
{cmd:c(linesize)} returns a numeric scalar equal to the current
{helpb linesize:set linesize} setting.
{phang}
{cmd:c(pagesize)} returns a numeric scalar equal to the current
{helpb pagesize:set pagesize} setting.
{phang}
{cmd:c(logtype)} returns a string containing "{cmd:smcl}" or "{cmd:text}"
indicating the current {helpb logtype:set logtype} setting.
{title:Interface settings}
{phang}
{cmd:c(dockable)} (Windows only) returns a string containing "{cmd:on}" or
"{cmd:off}" indicating the current {helpb dockable:set dockable} setting.
{phang}
{cmd:c(dockingguides)} (Windows only) returns a string containing "{cmd:on}" or
"{cmd:off}" indicating the current
{helpb dockingguides:set dockingguides} setting.
{phang}
{cmd:c(floatresults)} (Windows only) returns a string containing "{cmd:on}" or
"{cmd:off}" indicating the current {helpb floatresults:set floatresults}
setting.
{phang}
{cmd:c(floatwindows)} (Windows only) returns a string containing "{cmd:on}" or
"{cmd:off}" indicating the current {helpb floatwindows:set floatwindows}
setting.
{phang}
{cmd:c(locksplitters)} (Windows only) returns a string containing "{cmd:on}" or
"{cmd:off}" indicating the current
{helpb locksplitters:set locksplitters} setting.
{phang}
{cmd:c(xptheme)} (Windows only) returns a string containing "{cmd:on}" or
"{cmd:off}", indicating the current {helpb xptheme:set xptheme} setting.
{phang}
{cmd:c(linegap)} returns a numeric scalar equal to the current
{helpb linegap:set linegap} setting. If {cmd:set linegap} is
irrelevant under the version of Stata that is running,
{cmd:c(linegap)} returns a system missing value.
{phang}
{cmd:c(scrollbufsize)} returns a numeric scalar equal to the current
{helpb scrollbufsize:set scrollbufsize} setting. If
{cmd:set scrollbufsize} is irrelevant under the version of Stata you
are running, {cmd:c(scrollbufsize)} returns a system missing value.
{phang}
{cmd:c(varlabelpos)} returns a numeric scalar equal to the current
{helpb varlabelpos:set varlabelpos} setting. If
{cmd:set varlabelpos} is irrelevant under the version of Stata you
are running, {cmd:c(varlabelpos)} returns a system missing value.
{phang}
{cmd:c(reventries)} (Windows only) returns a numeric scalar containing the
maximum number of commands stored by the Review window; see
{helpb reventries}.
{phang}
{cmd:c(maxdb)} returns a numeric scalar containing the maximum number of
dialog boxes whose contents are remembered from one invocation to the
next during a session; see {helpb db}.
{phang}
{cmd:c(smalldlg)} (Windows 98 and ME only) returns a string containing
"{cmd:on}" or "{cmd:off}" indicating the current
{helpb smalldlg:set smalldlg} setting.
{title:Graphics settings}
{phang}
{cmd:c(graphics)} returns a string containing "{cmd:on}" or "{cmd:off}"
indicating the current {helpb set_graphics:set graphics} setting.
{phang}
{cmd:c(scheme)} returns the name of the current {helpb set scheme}.
{phang}
{cmd:c(printcolor)} returns "{cmd:automatic}", "{cmd:asis}",
"{cmd:gs1}", "{cmd:gs2}", or "{cmd:gs3}" indicating the current
{helpb set printcolor} setting.
{title:Efficiency settings}
{phang}
{cmd:c(adosize)} returns a numeric scalar equal to the current
{helpb adosize:set adosize} setting.
{phang}
{cmd:c(virtual)} returns a string containing "{cmd:on}" or "{cmd:off}"
indicating the current {helpb virtual:set virtual} setting.
{title:Mata settings}
{phang}
{cmd:c(matastrict)}
returns a string containing "{cmd:on}" or "{cmd:off}"
indicating the current {helpb matastrict:set matastrict} setting.
{phang}
{cmd:c(matalnum)}
returns a string containing "{cmd:on}" or "{cmd:off}"
indicating the current {helpb matalnum:set matalnum} setting.
{phang}
{cmd:c(mataoptimize}
returns a string containing "{cmd:on}" or "{cmd:off}"
indicating the current {helpb mataoptimize:set mataoptimize} setting.
{phang}
{cmd:c(matafavor)}
returns a string containing "{cmd:space}" or "{cmd:speed}"
indicating the current {helpb matafavor:set matafavor} setting.
{phang}
{cmd:c(matacache)}
returns a numeric scalar containing the maximum amount of memory, in
kilobytes, that may be consumed before Mata starts looking to drop autoloaded
functions that are not currently being used.
{phang}
{cmd:c(matalibs)}
returns a string containing the names and order of the {cmd:.mlib} libraries
to be searched; see {help m1_how:[M-1] how}.
{phang}
{cmd:c(matamofirst)}
returns a string containing "{cmd:on}" or "{cmd:off}"
indicating the current {helpb matamofirst:set matamofirst} setting.
{title:Network settings}
{phang}
{cmd:c(checksum)} returns a string containing "{cmd:on}" or "{cmd:off}"
indicating the current {helpb checksum:set checksum} setting.
{phang}
{cmd:c(timeout1)} returns a numeric scalar equal to the current
{helpb timeout1:set timeout1} setting.
{phang}
{cmd:c(timeout2)} returns a numeric scalar equal to the current
{helpb timeout2:set timeout2} setting.
{phang}
{cmd:c(httpproxy)} returns a string containing "{cmd:on}" or "{cmd:off}"
indicating the current {helpb httpproxy:set httpproxy} setting.
{phang}
{cmd:c(httpproxyhost)} returns a string containing the name of the
proxy host or {cmd:""} if no proxy host is set.
{cmd:c(httpproxyhost)} is relevant only if {cmd:c(httpproxy)}=="{cmd:on}".
{phang}
{cmd:c(httpproxyport)} returns a numeric scalar equal to the proxy port number.
{cmd:c(httpproxyport)} is relevant only if {cmd:c(httpproxy)}=="{cmd:on}".
{phang}
{cmd:c(httpproxyauth)} returns a string containing "{cmd:on}" or "{cmd:off}"
indicating the current {helpb httpproxy:set httpproxyauth} setting.
{cmd:c(httpproxyauth)} is relevant only if {cmd:c(httpproxy)}=="{cmd:on}".
{phang}
{cmd:c(httpproxyuser)} returns a string containing the name of the proxy
user or {cmd:""} if no proxy user is set.
{cmd:c(httpproxyuser)} is relevant only if
{cmd:c(httpproxyauth)}=="{cmd:on}" and {cmd:c(httpproxy)}=="{cmd:on}".
{phang}
{cmd:c(httpproxypw)} returns a string containing "{cmd:*}" if a password
is set or {cmd:""} otherwise.
{cmd:c(httpproxypw)} is relevant only if
{cmd:c(httpproxyauth)}=="{cmd:on}" and {cmd:c(httpproxy)}=="{cmd:on}".
{title:Update settings}
{phang}
{cmd:c(update_query)} (Windows and Macintosh only) returns a string containing
"{cmd:on}" or "{cmd:off}" indicating the current
{helpb update_query:set update_query} setting.
{phang}
{cmd:c(update_interval)} (Windows and Macintosh only) returns a numeric scalar
containing the current {helpb update_interval:set update_interval} setting.
{phang}
{cmd:c(update_prompt)} (Windows and Macintosh only) returns a string containing
"{cmd:on}" or "{cmd:off}" indicating the current
{helpb update_prompt:set update_prompt} setting.
{title:Trace (program debugging) settings}
{phang}
{cmd:c(trace)} returns a string containing "{cmd:on}" or "{cmd:off}"
indicating the current {helpb trace:set trace} setting.
{phang}
{cmd:c(tracedepth)} returns a numeric scalar reporting the current
{helpb trace:set tracedepth} setting.
{phang}
{cmd:c(tracesep)} returns a string containing "{cmd:on}" or "{cmd:off}"
indicating the current {helpb trace:set tracesep} setting.
{phang}
{cmd:c(traceindent)} returns a string containing "{cmd:on}" or "{cmd:off}"
indicating the current {helpb trace:set traceindent} setting.
{phang}
{cmd:c(traceexpand)} returns a string containing "{cmd:on}" or "{cmd:off}"
indicating the current {helpb trace:set traceexpand} setting.
{phang}
{cmd:c(tracenumber)} returns a string containing "{cmd:on}" or "{cmd:off}"
indicating the current {helpb trace:set tracenumber} setting.
{phang}
{cmd:c(tracehilite)} returns a string containing "{it:pattern}"
indicating the current {helpb trace:set tracehilite} setting.
{title:Other settings}
{phang}
{cmd:c(type)} returns a string containing "{cmd:float}" or "{cmd:double}"
indicating the current {helpb generate:set type} setting.
{phang}
{cmd:c(level)} returns a numeric scalar equal to the current
{helpb level:set level} setting.
{phang}
{cmd:c(maxiter)} returns a numeric scalar equal to the current
{helpb maxiter:set maxiter} setting.
{phang}
{cmd:c(searchdefault)} returns a string containing "{cmd:local}", "{cmd:net}",
or "{cmd:all}" indicating the current {helpb search:set searchdefault}
setting.
{phang}
{cmd:c(seed)} returns a string containing the current {helpb seed:set seed}
setting. This records the current state of the random-number generator
{helpb random:uniform()}.
{phang}
{cmd:c(varabbrev)} returns a string containing "{cmd:on}" or "{cmd:off}"
indicating the current {helpb varabbrev:set varabbrev} setting.
{title:Other}
{phang}
{cmd:c(pi)} returns a numeric scalar equal to {cmd:_pi}, the value of the
ratio of the circumference to the diameter of a circle. In an expression,
it makes no difference whether you use {cmd:c(pi)} or {cmd:_pi}.
{cmd:c(pi)}, however, may be used (enclosed in single quotes) in other
contexts.
{phang}
{cmd:c(alpha)} returns a string containing the space-separated list of the
lowercase letters.
{phang}
{cmd:c(ALPHA)} returns a string containing the space-separated list of the
uppercase letters.
{phang}
{cmd:c(Mons)} returns a string containing the space-separated list of month
names abbreviated to three characters.
{phang}
{cmd:c(Months)} returns a string containing the space-separated list of month
names.
{phang}
{cmd:c(Wdays)} returns a string containing the space-separated list of weekday
names abbreviated to three characters.
{phang}
{cmd:c(Weekdays)} returns a string containing the space-separated list of
weekday names.
{phang}
{cmd:c(rc)} returns a numeric scalar equal to {cmd:_rc}, the value set by
the {helpb capture} command. In an expression, it makes no difference
whether you use {cmd:c(rc)} or {cmd:_rc}. {cmd:c(rc)}, however, may be
used (enclosed in single quotes) in other contexts. This is less important
than it sounds because you could just as easily type {cmd:`=_rc'}.
{title:Also see}
{psee}Manual: {bf:[P] creturn}
{psee}
Online:
{helpb query},
{helpb return},
{help _variables}
{p_end}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -