Hi everyone,
I'm using the following code to rename every value label in my data set to be the same as the variable name. EG: for variable respage the value label would also be called respage.
I modified code I found from this old statalist post: https://www.stata.com/statalist/arch.../msg01077.html
When I run this code, I get the error "insufficient memory." I've dropped every variable I can and unused labels, but still no luck. Is there any way I can rename all the value labels that currently exist in my code to match the variable names? Thanks!
I'm using the following code to rename every value label in my data set to be the same as the variable name. EG: for variable respage the value label would also be called respage.
Code:
| *Get all vars with value labels ds, has(vallabel) local vars `r(varlist)' foreach var of local vars { // get the name of the value label for variable `var' local labname : value label `var' // create a copy with name of variable label copy `labname' `var', replace // assign that copy to variable `var' label value `var' `var' }
When I run this code, I get the error "insufficient memory." I've dropped every variable I can and unused labels, but still no luck. Is there any way I can rename all the value labels that currently exist in my code to match the variable names? Thanks!
Comment