Often times survey data needs to be modified prior to analysis. You can make changes to data in a tool like Excel, then upload into Protobi. But there is also the option to change survey data programmatically within the app. We refer to this as data processing.
Why process data?
Even for the best designed surveys, you may need to do additional data refactoring and cleaning:
- create a new variable
- remove respondents
- combine waves
- merge in translations
- stack patient cases, choice cards, etc.
yearinto a single date
Process data in Protobi or externally
One way to change data is in SPSS, SAS, R, Excel, or another tool to edit the data prior to uploading it to Protobi as a data table. This might be the easiest solution for one-time changes. But you can do some serious data processing in Protobi as well.
One advantage of making changes to data in Protobi is that all your processing code is in one place, neatly organized, with changes tracked. So if you get new data, or later need to review the changes you made, it's all visible in one place.
Add a data process
In the data tab of project settings press the green "+ New process" button to add a data process.
You will be prompted to give the process a name:
From the process table, press "Edit/Run".
You will be taken to the code-view page. There is default return data code that simply returns whatever data file in the "main" table.
Beneath that there are some comments, and some pre-written code with two backslashes at the front of the code. Slashes in front of code means it will not work and will be read as a comment.
Delete the code in line one. Then, delete the double slashes (//) from the front of the pre-written code. It should like like screenshot below. From here, you can start adding code inside the function.