Example: tourism industry

Title stata.com egen — Extensions to generate

Extensions to generateSyntaxMenuDescriptionRemarks and examplesMethods and formulasAcknowledgmentsReferencesAlso seeSyntaxegen[type]newvar=fcn(arguments) [if][in][,options]byis allowed with some of theegenfunctions, as noted depending on thefcn,argumentsrefers to an expression,varlist, ornumlist, and theoptionsare alsofcndependent, and wherefcnisanycount(varlist), values(integer numlist)may not be combined withby. It returns the number of variables invarlistfor which values areequal to any integer value in a suppliednumlist. Values for any observations excluded by eitheriforinare set to 0 (not missing). Also seeanyvalue(varname)andanymatch(varlist) .anymatch(varlist), values(integer numlist)may not be combined withby.

ends of the grouping intervals specified in the at() option, which expects an ascending numlist. at(#,#,:::,#) supplies the breaks for the groups, in ascending order. The list of breakpoints may be simply a list of numbers separated by commas but can also include the syntax a(b)c, meaning from a to c in steps of size b.

Tags:

  Ascending

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of Title stata.com egen — Extensions to generate

1 Extensions to generateSyntaxMenuDescriptionRemarks and examplesMethods and formulasAcknowledgmentsReferencesAlso seeSyntaxegen[type]newvar=fcn(arguments) [if][in][,options]byis allowed with some of theegenfunctions, as noted depending on thefcn,argumentsrefers to an expression,varlist, ornumlist, and theoptionsare alsofcndependent, and wherefcnisanycount(varlist), values(integer numlist)may not be combined withby. It returns the number of variables invarlistfor which values areequal to any integer value in a suppliednumlist. Values for any observations excluded by eitheriforinare set to 0 (not missing). Also seeanyvalue(varname)andanymatch(varlist) .anymatch(varlist), values(integer numlist)may not be combined withby.

2 It is 1 if any variable invarlistis equal to any integer value ina suppliednumlistand 0 otherwise. Values for any observations excluded by eitheriforinare set to 0 (not missing). Also seeanyvalue(varname)andanycount(varlist) .anyvalue(varname) , values(integer numlist)may not be combined withby. It takes the value ofvarnameifvarnameis equal to anyinteger value in a suppliednumlistand is missing otherwise. Also seeanymatch(varlist)andanycount(varlist) .concat(varlist)[, format(%fmt) decode maxlength(#) punct(pchars)]may not be combined withby. It concatenatesvarlistto produce a string variable. Values ofstring variables are unchanged. Values of numeric variables are converted to string, as is, orare converted using a numeric format under theformat(%fmt)option or decoded under thedecodeoption, in which casemaxlength()may also be used to control the maximum labellength used.

3 By default, variables are added end to end:punct(pchars)may be used to specifypunctuation, such as a space,punct(" "), or a comma,punct(,).count(exp)(allowsbyvarlis t:)creates a constant (withinvarlist) containing the number of nonmissing observations seerownonmiss()androwmiss().cut(varname) ,{at(#,#,..,#)|group(#)}[icodes label]may not be combined withby. It creates a new categorical variable coded with the left-handends of the grouping intervals specified in theat()option, which expects an ascending (#,#,..,#)supplies the breaks for the groups, in ascending order. The list of breakpointsmay be simply a list of numbers separated by commas but can also include the syntaxa(b)c,meaning fromatocin steps of sizeb.

4 If no breaks are specified, the command expects thegroup() (#)specifies the number of equal frequency grouping intervals to be used in the absenceof breaks. Specifying this option automatically egen Extensions to generateicodesrequests that the codes 0, 1, 2, etc., be used in place of the left-hand ends of that the integer-coded values of the grouped variable be labeled with theleft-hand ends of the grouping intervals. Specifying this option automatically (varlist)may not be combined withby. It creates an indicator variable equal to 1 if the variables invarlistare not equal and 0 (strvar)[, punct(pchars) trim[head|last|tail]]may not be combined withby.

5 It gives the first word or head (with theheadoption), thelast word (with thelastoption), or the remainder or tail (with thetailoption) from ,last, andtailare determined by the occurrence ofpchars, which is by default onespace ( ).The head is whatever precedes the first occurrence ofpchars, or the whole of the string if itdoes not occur. For example, the head of frog toad is frog and that of frog is frog .Withpunct(,), the head of frog,toad is frog .The last word is whatever follows the last occurrence ofpcharsor is the whole of the stringif a space does not occur. The last word of frog toad newt is newt and that of frog is frog.

6 Withpunct(,), the last word of frog,toad is toad .The remainder or tail is whatever follows the first occurrence ofpchars, which will be theempty string""ifpcharsdoes not occur. The tail of frog toad newt is toad newt and thatof frog is"". Withpunct(,), the tail of frog,toad is toad .Thetrimoption trims any leading or trailing (numlist)may not be combined withby. It creates a variable of ascending or descending numbers orcomplex repeating contain at least two numbers and may be specifiedusing standardnumlistnotation; see[U] not allowed withfill().group(varlist)[, missing label lname(name) truncate(num)]may not be combined withby. It creates one variable taking on values 1, 2.

7 For the groupsformed contain numeric variables, string variables, or a combination ofthe two. The order of the groups is that of the sort order thatmissing values invarlist( "") are to be treated like any other value when assigninggroups, instead of as missing values being assigned to the group missing. Thelabeloptionreturns integers from 1 up according to the distinct groups ofvarlistin sorted order. The integersare labeled with the values ofvarlistor the value labels, if they ()specifies thename to be given to the value label created to hold the labels;lname()implieslabel. Thetruncate()option truncates the values contributed to the label from each variable invarlistto the length specified by the integer argumentnum.

8 Thetruncateoption cannot be usedwithout specifying thelabeloption. Thetruncateoption does not change the groups thatare formed; it changes only their (exp)(allowsbyvarlist:)creates a constant (withinvarlist) containing the interquartile range ofexp. Also seepctile().kurt(varname)(allowsbyvarlis t:)returns the kurtosis (withinvarlist) (exp)(allowsbyvarlist:)returns the median absolute deviation from the median (withinvarlist) Extensions to generate 3max(exp)(allowsbyvarlist:)creates a constant (withinvarlist) containing the maximum value (exp)(allowsbyvarlist:)returns the mean absolute deviation from the mean (withinvarlist) (exp)(allowsbyvarlist:)creates a constant (withinvarlist) containing the mean (exp)(allowsbyvarlist:)creates a constant (withinvarlist) containing the median ofexp.

9 Also seepctile().min(exp)(allowsbyvarlist:)cr eates a constant (withinvarlist) containing the minimum value (varname)[, minmode maxmode nummode(integer) missing](allowsbyvarlist:)produces the mode (withinvarlist) forvarname, which may be numeric or string. The modeis the value occurring most frequently. If two or more modes exist or ifvarnamecontainsall missing values, the mode produced will be a missing value. To avoid this, theminmode,maxmode, ornummode()option may be used to specify choices for selecting among the multiplemodes, and themissingoption will treat missing values as thelowest value, andmaxmodereturns the highest (#)will return the#th mode,counting from the lowest up.

10 Missing values are excluded from determination of the modeunlessmissingis specified. Even so, the value of the mode is recorded for observations forwhich the values ofvarnameare missing unless they are explicitly excluded, that is, byifvarname< .orifvarname!= "".mtr(year income)may not be combined withby. It returns the marginal income tax rate for a married couplewith taxable incomeincomein yearyear, where 1930 year specified as variable names or constants; for example,mtr(1993 faminc),mtr(surveyyr28000), ormtr(surveyyr faminc). A blank or comma may be used to (exp)[, prop](allowsbyvarlist:)returnsexp(within varlist) scaled to be a percentage of the total, between 0 and 100.


Related search queries