Skip to content

Haven converts some labelled Stata variable into numeric rather than haven_labelled #551

@jkhanson1970

Description

@jkhanson1970

Please briefly describe your problem and what output you expect. If you have a question, please don't use this form. Instead, ask on https://stackoverflow.com/ or https://community.rstudio.com/.

Please include a minimal reproducible example (AKA a reprex). If you've never heard of a reprex before, start by reading https://www.tidyverse.org/help/#reprex.


Haven converts some labelled Stata variable into numeric rather than haven_labelled

library(haven)
anes2016 <- read_dta("anes2016subset.dta")

In the provided dataset, the variables Sex, RaceEthnic, EducLevel, HSgrad, and BAplus should all become haven_labelled upon import into R. As far as I know, they are no different in Stata than many other variables in the dataset that do become haven_labelled upon import: each variable has value labels in Stata. In previous versions of the same dataset, prior to adding the Sex variable, Haven converted all the above-listed variables into haven_labelled.
anes2016subset.dta.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions