If no type is specified, the new variable type is determined by the type of result returned by =exp. A float variable (or a double, according to set type) is created if the result is numeric, and a string variable is created if the result is a string. In the latter case, if the...
Quick start Create numeric variable newv1 equal to v1 + 2 generate newv1 = v1 + 2 As above, but use type byte and label the values of newv1 with value label mylabel generate byte newv1:mylabel = v1 + 2 String variable newv2 equal to "my text" generate newv2 = "my text"...
matrow(matname) saves the numeric values of the × 1 row stub in matname. This option is for use by programmers. matrow() may not be specified if the row variable is a string. Limits A one-way table may have a maximum of 12,000 rows (Stata/MP and Stata/SE) or 3,000 rows (...
generate newv1 = v1 + 2 As above, but use type byte and label the values of newv1 with value label mylabel generatebytenewv1:mylabel=v1+2 String variable newv2 equal to “my text” generate newv2 = "my text" Variable newv3 equal to the observation number generate newv3 = _n ...
(v1 v2 v3), strok Generate newv5 as the concatenation of numeric v1 and string v4 separated by a space egen newv5 = concat(v1 v4), punct(" ") Menu Data > Create or change data > Create new variable (extended) 1 2 egen — Extensions to generate Syntax egen [ type ] newvar =...
a string variable. It comes from the wdi database. As I want them in euros, and that the exchange rate is 1.06 (year is 2003), I wrote to stata: encode healthinit, gen(H) generate health=1.06*H H is a long variable. Danke schön für die Helfe!
Quick start Create numeric variable newv1 equal to v1 + 2 generate newv1 = v1 + 2 Same as above, but use type byte and label the values of newv1 with value label mylabel generate byte newv1:mylabel = v1 + 2 String variable newv2 equal to "my text" generate newv2 = "my ...