Stata 15 help for prefix

Title

[U] 11.1.10 Prefix commands

Syntax

prefix ...: command ...

prefix Description ------------------------------------------------------------------------- by run command on subsets of data statsby same as by, but collect statistics from each run rolling run command on moving subsets and collect statistics

bootstrap run command on bootstrap samples jackknife run command on jackknife subsets of data permute run command on random permutations simulate run command on manufactured data

svy run command and adjust results for survey sampling mi estimate run command on multiply imputed data and adjust results for multiple imputation (MI)

bayes fit model as a Bayesian regression fmm fit model using finite mixture modeling

nestreg run command with accumulated blocks of regressors and report nested model comparison tests stepwise run command with stepwise variable inclusion/exclusion

xi run command after expanding factor variables and interactions; for most commands, using factor variables is preferred to using xi (see fvvarlist)

fp run command with fractional polynomials of one regressor mfp run command with multiple fractional polynomial regressors

capture run command and capture its return code noisily run command and show the output quietly run command and suppress the output version run command under specified version -------------------------------------------------------------------------

The last group -- capture, noisily, quietly, and version -- deal with programming Stata and, for historical reasons, capture, noisily, and quietly allow you to omit the colon.

Description

Prefix commands operate on other Stata commands. They modify the input, modify the output, or repeat execution of the command. For example, mfp modifies the varlist of command by including fractional polynomial terms. svy modifies the results of command to account for complex survey data. by executes command on subgroups of the data.

See language for an overview of the Stata language.

Remarks

Prefix commands are not allowed in all contexts. For instance, svy, nestreg, and stepwise may be used only with supported estimation commands. bootstrap, jackknife, ... make no sense when combined with a command like generate.

Many of the prefix commands can be combined. For instance,

nestreg: svy: regress brate (medage) (medagesq) (reg2-reg4)

However, some combinations of prefix commands are not allowed. For example,

bootstrap: statsby: logit diabetes female age

is not allowed because statsby saves results to a dataset and not in r() or e().

Examples

. sysuse auto . by foreign (make), sort: summarize rep78 . statsby, by(foreign): regress mpg gear turn

. sysuse auto, clear . bootstrap, reps(100): regress mpg weight gear foreign

. webuse nhanes2d, clear . svy, subpop(female): logistic highbp height weight age c.age#c.age

. sysuse auto, clear . mfp: regress mpg weight displacement foreign . bayes: regress price length i.foreign


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