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

Flag labels with longer than desired length #8

Open
arthur-shaw opened this issue Dec 26, 2023 · 0 comments
Open

Flag labels with longer than desired length #8

arthur-shaw opened this issue Dec 26, 2023 · 0 comments
Labels
value 🏷️ Value label

Comments

@arthur-shaw
Copy link
Contributor

arthur-shaw commented Dec 26, 2023

Problem

Survey Solutions applies as value labels the answer option text provided in Designer. For most cases, that's exactly what's needed. For other cases, the label in Designer may be the perfect length for an interview, but too long for data users. In other words, data producers may want to shorten the length of labels for readability/usability for data users. However, there's no straightforward means of identifying value labels that are longer than desired.

Solution

Identify value labels that are equal to or greater than a user-defined desired length. By default, this value should be Survey Solutions' max value label length (250 characters). However, this value should be user-settable.

This might include a few commands:

  • lbl_list_val_max_len
  • lbl_assert_no_val_max_len

Implementation ideas

  • Identify variables (in varlist, by default all variables) that have value labels via ds, has(vallabel)
  • Create a frame of labels via uselabel
  • Compute the length of each value label
  • Report on value labels that are too long (if any)
  • Return a list of variables with offending value labels in r(varlist) and a list of labels in r(val_labels) (or macro name that fits convention for value labels)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
value 🏷️ Value label
Projects
None yet
Development

No branches or pull requests

1 participant