Description Usage Arguments Value Examples
generates a new variable that is a transformation of existing variables in the dataset or replaces one
1 |
var |
the name of the variable to be generated |
value |
the transformation of the dataset to replace the "newvar" in option |
byvar |
apply the value for each level of the by variables, specified either as a formula, like ~byvar1+byvar2+... or as a varlist "byvar1 byvar2 byvar3...". |
subset |
only generate values if the condition provided in subset is true. Make sure to enclose the expression in quotes, like so: subset="female==1 & highschool==1" to generate the values only for women who graduated from highschool. This option is used like the "if" in Stata. |
replace |
either TRUE or FALSE. If FALSE (default), the code refuses to alter the variable if the variable already exists. Otherwise, if replace=TRUE, then the values will be replaced. |
returns NULL, invisibly
1 2 3 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.