You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently discovered this package and think it's awesome. However, there is one significant downside to using this compared to downloading the data directly from Qualtrics.
I tend to download my data via the SPSS option so that each variable has both the label and labels attributes. This makes it easy to convert numeric variables to factors via the labels attribute but also to calculate means with the numeric vector.
I have tried almost all of the arguments in fetch_survey() trying to get this but none of them add the labels attribute to the variables. Having the option of downloading the data where each variable has value labels (labels attribute) would be incredibly valuable.
While I'm not at all familiar with the API, I would assume that there I some way of accessing the data from Qualtrics in the SPSS style instead of csv.
Nevertheless, this how I'd like the data set up with value labels:
ideal_df <- data.frame(
a = c(3, 4, 4, 4, 1, 2, 3, 1) %>%
structure(
label = "Variable A as numeric with value labels",
labels = c("Strongly agree" = 1, "Somewhat agree" = 2, "Somewhat disagree" = 3, "Strongly disagree" = 4)
),
b = c(1, 1, 2, 2, 1, 3, 3, 4) %>%
structure(
label = "Variable B as numeric with value labels",
labels = c("Strongly agree" = 1, "Somewhat agree" = 2, "Somewhat disagree" = 3, "Strongly disagree" = 4)
)
)
Now here are the kinds of data sets you get from fetch_survey()
# a data set that you get when the `label` argument is FALSE
label_TRUE <- data.frame(
a = c("Somewhat disagree", "Strongly disagree", "Strongly disagree", "Strongly disagree", "Strongly agree", "Somewhat agree", "Somewhat disagree", "Strongly agree") %>%
structure(label = "Variable A as a character vector"),
b = c("Strongly agree", "Strongly agree", "Somewhat agree", "Somewhat agree", "Strongly agree", "Somewhat disagree", "Somewhat disagree", "Strongly disagree") %>%
structure(label = "Variable b as a character vector")
)
# a data set that you get when the `label` argument is FALSE
label_FALSE <- data.frame(
a = c(3, 4, 4, 4, 1, 2, 3, 1) %>%
structure(
label = "Variable A as numeric without value label",
),
b = c(1, 1, 2, 2, 1, 3, 3, 4) %>%
structure(
label = "Variable B as numeric without value label",
)
)
The text was updated successfully, but these errors were encountered:
This should be possible. The Qualtrics API specifies that if useLabels is FALSE, which is the default, one can specify includeLabelColumns = TRUE to "export two columns: one that uses recode values and one that uses labels."
It would probably change the way the data is cleaned after the export, because you'd manually have to say that every column marked IsLabelColumn should be turned into labels for the corresponding non-labelled column, and it might make the download take a bit longer because there would be up to twice as many columns. But it should work!
I recently discovered this package and think it's awesome. However, there is one significant downside to using this compared to downloading the data directly from Qualtrics.
I tend to download my data via the SPSS option so that each variable has both the label and labels attributes. This makes it easy to convert numeric variables to factors via the labels attribute but also to calculate means with the numeric vector.
I have tried almost all of the arguments in
fetch_survey()
trying to get this but none of them add the labels attribute to the variables. Having the option of downloading the data where each variable has value labels (labels attribute) would be incredibly valuable.While I'm not at all familiar with the API, I would assume that there I some way of accessing the data from Qualtrics in the SPSS style instead of csv.
Nevertheless, this how I'd like the data set up with value labels:
Now here are the kinds of data sets you get from
fetch_survey()
The text was updated successfully, but these errors were encountered: