Skip to content

SurveyQuestion should report the total number of categories used for poststratification #110

@mitzimorris

Description

@mitzimorris

It would be nice to be able to know the total number of unique poststratification categories - e.g., given a mapping:

> marstat_mapping = list(
+     "Married" = "Married",
+     "Separated" = "Separated",
+     "Divorced" = "Divorced",
+     "Widowed" = "Widowed",
+     "Never married" = "Never married",
+     "Domestic / civil partnership" = "Married"
+ )
> q_marstat <- SurveyQuestion$new(name = "marstat",
+     col_names = c("marstat", "marst2"),
+     values_map= marstat_mapping)

the call q_marstat.values() returns a list of length 6:

> q_marstat$values()
                       marstat        marst2
1                      Married       Married
2                    Separated     Separated
3                     Divorced      Divorced
4                      Widowed       Widowed
5                Never married Never married
6 Domestic / civil partnership       Married

but only increases the size of the poststrat table by a factor of 5.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions