Reported as tidyverse/haven#551
Variables whose value labels appear on the label list prior to one with an empty value label are not assigned their value labels.
Step 1:
input x y z 0 0 0 end lab def xlab 0 "Foo" lab val x xlab lab def ylab 0 "Bar" lab val y ylab lab def ylab 0 "", modify // This is one way to create an "empty" value label. It does *not* create a value label with an empty string for value 0. lab def zlab 0 "FooBar" lab val z zlab label list save example_input
Step 2: readstat example_input.dta example_output.dta
Actual example_output.dta
:
Expected example_output.dta
:
(Minor detail: the blueness of the 0
indicates the presence of an [empty] value label for variable y
; I have no strong opinion on whether this value label should be preserved in the output file.)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4