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

Saving the skipped questions to database as well #29

Open
Gryphire opened this issue Jul 18, 2018 · 6 comments
Open

Saving the skipped questions to database as well #29

Gryphire opened this issue Jul 18, 2018 · 6 comments

Comments

@Gryphire
Copy link

Hi there!

First off, thanks so much for writing all of this code and documentation, it's incredibly useful!

I'm almost done customising my ESM app with two skip logic branches, but I'm wondering whether it is possible to save the skipped questions to the database as well (with some kind of identifying value, like -1), to make sure the data length for each subject and sample is the same.

I was thinking of maybe doing something along the lines of specifying a certain response value (i.e. -1) for the remaining questions in the same place as where I have the 'go to the last page' command:

else if (count == 3 && response >= 1) {$("#question").fadeOut(400, function () {$("#question").html("");app.renderQuestion(4); SPECIFYING REMAINING RESPONSES HERE});}'

But I can't seem to figure out how to implement that exactly, mainly because it feels like there are no specific response variables for each question (e.g. "q1_resp") that are subsequently saved to the database? Correct me if I'm wrong, of course!

Any tips on how to best do this would be very much appreciated! (:

Cheers,
Nastasia

@sabrinathai
Copy link
Owner

Hi Nastasia,

In the past, I have never needed this function because when you organize the data to analyze, some participants will have the missing variable and others will not. For those who do not have it, there will just be a missing value. Would that suffice? Or do you still want to create this function?

@Gryphire
Copy link
Author

Hi Sabrina,

Thanks for your reply!

Well, the thing is, in my data the skipped variables are absent completely. Meaning that the amount of rows, put bluntly, is different, and I’d like to avoid the hassle of having to add the missing questions and their missing values after collection.

Are you saying that the script already does this in your case?

Thanks again!

@sabrinathai
Copy link
Owner

sabrinathai commented Sep 9, 2018

Hi Natasia

You don't have to add the missing questions of missing values after data collection. What will happen is the following.

If the skipped questions are called "question3" and "question5", and you have 3 participants, this is what their data will like look:

Participant 1: "question1", "question2", "question4"
Participant2: "question1", "question2", "question3", "question4", "question5"
Participant3: "question1", "question2", "question3", "question4"

When you merge the dataset together using the R script I've created, the dataset will have all the variables and missing values for participants who don't have a value for a a specific variable.

@Gryphire
Copy link
Author

Hi Sabrina,

Sorry, I hadn't gotten around to implementing that data merging script you've got as well yet, since I've got a feeling that the Google data sheets (database, compliance, splicedDatabase) need to be all in order for that script to work (if not please correct me), but at the moment my compliance checker isn't working (I've posted a comment regarding this issue in BizerkMaverik's closed thread today) so I've got a feeling that the splicedDatabase isn't the way it should be.

Do you happen to have an example of the splicedDatabase sheet?

Cheers,
Nastasia

@vicomello
Copy link

I have the same question.

Currently, my data is being saved on splicedDataset like this:
image

I feel like it would be hard to analyze the data later because 1) every key has a different name and 2) the missing values are not stored.

Is this what I'm supposed to get in the splicedDataset file? Is the R script suited to handle this type of data?

Thanks!

@sabrinathai
Copy link
Owner

There are two scripts to do this in the Data Organization R Option as mentioned above. The first one Splice, Prepare, and Clean Google Data.R will splice the data so your survey id is separate from your variable name. Convert Data.R will create an empty dataset with all the variables, so participants will have missing values for questions they do not answer.

These scripts have been heavily annotated to help you understand what is going on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants