Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stata and labelled non-integers #447

Closed
dusadrian opened this issue Apr 18, 2019 · 3 comments
Closed

Stata and labelled non-integers #447

dusadrian opened this issue Apr 18, 2019 · 3 comments

Comments

@dusadrian
Copy link

dusadrian commented Apr 18, 2019

There are two closed issues containing that Stata only support labelled integers. I tested that, and it does not seem to be the case. First, generated a data frame and exported to SPSS:

x1 <- labelled_spss(c(1.1, 1:10), c(Good = 1, Bad = 8), na_range = c(9, Inf),
                     label = "Quality rating")
write_sav(data.frame(X = x1), "test.sav")

Then converted the SPSS file to Stata .dta using StatTransfer. Then read the .dta file in Stata/IC version 12, and the following appears:

                  type:  numeric (float)
                 label:  x, but 7 nonmissing values are not labeled

                 range:  [1,8]                        units:  .1
         unique values:  9                        missing .:  2/11

            tabulation:  Freq.   Numeric  Label
                             1         1  good
                             1       1.1  
                             1         2  
                             1         3  
                             1         4  
                             1         5  
                             1         6  
                             1         7  
                             1         8  bad
                             2         .  

It appears not to be true that "Stata only supports labelled integers", but a problem with readstat.

@batpigandme
Copy link
Contributor

Linking to cross post on community here.

@dusadrian
Copy link
Author

Thanks, the newest version 2.1.0 no longer throws this error, instead it checks whether labelled values are integers.

@lock
Copy link

lock bot commented Oct 19, 2019

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

@lock lock bot locked and limited conversation to collaborators Oct 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants