.- help for ^accrue^ (STB-32: dm42) .- Accrue ------ ^accrue cmd^ command-string ^accrue by^ varlist ^accrue using^ filename ^accrue macros^ macroname-list ^accrue mnames^ macroname-to-newvarname-list ^accrue results^ integer-result-vector-list ^accrue rnames^ result-to-newvarname-list ^accrue coeffs^ coefficient-varlist ^accrue cnames^ [coefficient-to-newvarname-list] ^accrue stderrs^ standard-errors-varlist ^accrue snames^ [standard-errors-to-newvarname-list] ^accrue query^ ^accrue clear^ ^accrue exec [replace noisily nomsg]^ Description ----------- ^accrue^ provides a set of tools to allow you to either accrue statistics across a by group, run an ado-command across a by group, or both. Its primary use is to aggregate statistics from a command that are collected from a run of that command for each of the groups defined by the variables specified in the ^accrue by^ varlist. It will accrue these statistics into a dataset that you specify with the ^accrue using^ filename command. The statistics that you may collect include the _result() vector entries or global macros that are set by the command such as S_lambda or _b[_cons]. You specify the statistics to collect with the ^accrue results^ and the ^accrue macros^ commands and then specify the names to give the variables that will hold the collected statistics with the ^accrue rnames^ and the ^accrue mnames^ commands. As there are many parts to using this command, you can also use the ^accrue query^ to see what parts have been defined. Individual commands ------------------- ^accrue cmd^ command-string This command specifies the command to be run for each of the groups. it can be an internal stata command or an ado file. ^accrue by^ varlist This command specifies the variables to use to define the groups over which the command string will be executed. ^accrue using^ filename This command will specify the filename into which to store the collected statistics. ^accrue macros^ macroname-list This command specifies the macros that should be collected after each run of the command string. You can specify macros such as S_depv, S_lambda, _b[_cons], _se[_cons], etc. ^accrue mnames^ macroname-to-newvarname-list This command specifies the variable names to use to hold the macros specified in the ^accrue macros^ list. It is a one-to-one correspondence to the list in the ^accrue macros^ list. ^accrue results^ integer-result-vector-list This command specifies the entries in the _result() vector that you would like to collect. Look in the Saved Results section of the commandstring that you are executing to find out which of the entries that you would like to save. The list is a list of integers. ^accrue rnames^ result-to-newvarname-list This command specifies the variable names to use to hold the result vector entries specified in the ^accrue results^ list. It is a one-to-one correspondence to the list given in the ^accrue results^ command. ^accrue coeffs^ varlist This command specifies the variable names for which you would like to save the _b[] values. Note that this is required to be a variable list so that you cannot use ^_cons^ here to save the coefficient of the constant. In order to save the coefficient of the constant, you need to specify ^_b[_cons]^ as one of the arguments to ^accrue macros^. ^accrue cnames^ coeffs-to-varname-list If you have specified variable names for ^accrue coeffs^ and do not specify names here, the variable names will be used. Otherwise, the coefficients that you requested will be saved in the corresponding names that you specify here. This list (if it exists) must be the same length as the list of variable names specified in the ^accrue coeffs^ command. ^accrue stderrs^ varlist This command specifies the variable names for which you would like to save the _se[] values. Note that this is required to be a variable list so that you cannoe use ^_cons^ here to save the standard error of the constant. In order to sace the standard error of the constant, you need to specify ^_se[_cons]^ as one of the arguments to the ^accrue macros^. ^accrue snames^ standard-errors-to-varname-list If you have specified variable names for ^accrue stderrs^ and do not specify names here, the variable names will be used. Otherwise, the standard errors that you requested will be saved in the corresponding names that you specify here. This list (if it exists) must be the same length as the list of variable names specified in the ^accrue stderrs^ command. If you specify variables in ^accrue coeffs^ and ^accrue stderrs^, then at least one of ^accrue cnames^ or ^accrue snames^ must be specified. ^accrue query^ This command prints out all of the parts of the accrue command that have been specified. ^accrue clear^ This command clears out all of the entris in the accrue command that may be laying around from a previous use. ^accrue exec [replace noisily nomsg]^ This command starts the execution of the command string and possible collection of statistics. You are not required to collect statistics. This means that you might want to run this command with the noisily specifier so that you can simply log the output of the command string over the groups. The nomsg option suppresses accrue from printing the current values of the by group variables. Examples -------- . ^use auto^ . ^accrue by rep78^ . ^accrue exec logit foreign price weight length if mpg<30 in 1/50^ . ^accrue results 2 3 6 7^ . ^accrue rnames llik chidf chisq rsquare^ . ^accrue using results^ . ^accrue exec^ Author ------ James W. Hardin Stata Corporation stata@@stata.com Also See -------- Manual: collapse STB: @coll2@, if installed On-line: help for @collapse@