# New resource available: Stata program for handling ODK forms and data

**URL:** <https://forum.getodk.org/t/new-resource-available-stata-program-for-handling-odk-forms-and-data/2787>\
**Category:** Support\
**Created:** [December 20, 2013, 4:46pm UTC](https://forum.getodk.org/t/new-resource-available-stata-program-for-handling-odk-forms-and-data/2787 "2013-12-20T16:46:59Z")\
**Posts on this page:** 8\
**Page:** 2

<div class="post-metadata">

**Author:** ![Lindsey\_Shaughnessy](https://getodk.b-cdn.net/letter_avatar_proxy/v4/letter/l/b38774/32.png) [@Lindsey\_Shaughnessy](https://forum.getodk.org/u/Lindsey_Shaughnessy)\
**Post date:** [August 5, 2014, 3:26pm UTC](https://forum.getodk.org/t/new-resource-available-stata-program-for-handling-odk-forms-and-data/2787/21 "2014-08-05T15:26:38Z")

</div>

Hi Sydney,

No, we have not created a video, but there is an extensive help file  
available both through GitHub ([https://github.com/matthew-white/odkmeta](https://github.com/matthew-white/odkmeta))  
and the program's Stata helpfile.

Under the "Examples" section, you will see some lines of code for creating  
a new do-file. To do so, you will need to take your xlsform and save your  
survey and choices worksheets as individual csv files, and to have your  
data csv files ready as well.

Let me know if you have any particular questions.

Lindsey

> **···**
>
> On Tue, Aug 5, 2014 at 10:34 AM, Sydney Rodney Lungu \<sydneyrodney@gmail.com wrote:
> 
> > Hi all,
> > 
> > Is there a short video that explains the steps/how this is done? if so,  
> > can one share the video.
> > 
> > On Thursday, June 12, 2014 3:35:43 PM UTC+2, [till.be...@gmail.com](mailto:till.be...@gmail.com) wrote:
> > 
> > > Hi again,
> > > 
> > > I was able to solve Koens problem for me by making sure that csv files  
> > > are separated by comma, not by semicolon. Programs such as German language  
> > > excel in my case use semicolon delimiter as default. I needed to change  
> > > region settings to US to produce a comma separated csv, which is now  
> > > accepted by odkmeta!
> > > 
> > > Best Till
> > > 
> > > Am Mittwoch, 9. April 2014 19:29:23 UTC+2 schrieb Lindsey Shaughnessy:
> > > 
> > > > Hi Koen,
> > > > 
> > > > Thanks for letting us know you're facing this issue.
> > > > 
> > > > odkmeta is written to read csv files, rather than xlsforms with  
> > > > multiple worksheets. Can you save your choices and survey worksheets as  
> > > > individual csvs, and then try running odkmeta? Let me know if that doesn't  
> > > > solve your problems.
> > > > 
> > > > Lindsey
> > > > 
> > > > On Wed, Apr 9, 2014 at 12:11 PM, Koen [koen.l...@gmail.com](mailto:koen.l...@gmail.com) wrote:
> > > > 
> > > > Lindsey,  
> > > > This looks really interesting. However, I have not yet gotten it to  
> > > > work. With every xlsform I've tried so far, odkmeta throws back "column  
> > > > header type not found, invalid type() suboption, invalid survey() option"  
> > > > at me. But it's there. Has this issue been noticed before?
> > > > 
> > > > The command I've issued looks like this:  
> > > > odkmeta using test.do, csv(CSV) survey(XL) choices(XL)  
> > > > Where CSV is the exact path to the CSV datafile, and XL is the path to  
> > > > the XLSForm. I've tried making the type heading explicit by including the  
> > > > ,type(type) suboption, but it didn't work.
> > > > 
> > > > Is this some known issue, or would you need some further information  
> > > > from my part?  
> > > > Koen
> > > > 
> > > > Koen
> > > > 
> > > > On Wednesday, January 15, 2014 4:40:42 PM UTC+1, Lindsey Shaughnessy wrote:
> > > > 
> > > > Hi Mitch,
> > > > 
> > > > Of course. You can find links to the program itself, to the helpfile,  
> > > > and to sample data/files here: [http://econpapers.repec](http://econpapers.repec).  
> > > > org/software/bocbocode/S457767.htm.
> > > > 
> > > > I'm also attaching a pdf of the program's Stata helpfile, up-to-date as  
> > > > of 2014-01-13.
> > > > 
> > > > Glad to hear there are many Stata and ODK users!
> > > > 
> > > > Lindsey
> > > > 
> > > > On Tue, Jan 14, 2014 at 6:41 PM, Mitch Sundt [mitche...@gmail.com](mailto:mitche...@gmail.com) wrote:
> > > > 
> > > > Hi LIndsey,
> > > > 
> > > > Do you have a link to this documentation? I would love to add an entry  
> > > > under the Help section, as many other groups are interested in using ODK  
> > > > with Stata.
> > > > 
> > > > Mitch
> > > > 
> > > > On Tue, Jan 14, 2014 at 1:45 PM, Lindsey Shaughnessy \< [lshaug...@poverty-action.org](mailto:lshaug...@poverty-action.org)\> wrote:
> > > > 
> > > > Dear Stata users of the ODK community,
> > > > 
> > > > IPA is happy to announce that odkmeta v1.1 is now publicly available on  
> > > > SSC! In Stata, simply type the command -ssc install odkmeta- to install the  
> > > > program.
> > > > 
> > > > What does -odkmeta- do? In a nutshell/as a reminder, -odkmeta-  
> > > > automatically generates a do-file to clean and merge your raw Open Data Kit  
> > > > data. More specifically, -odkmeta- creates a do-file to import ODK  
> > > > data, using the metadata from the survey and choices worksheets of  
> > > > the XLSForm. The do-file completes the following tasks in order:  
> > > > imports lists as value labels; adds other values to value labels;  
> > > > imports field attributes as characteristics; splits select\_multiple  
> > > > variables; drops note variables; formats date, time, and datetime  
> > > > variables; attaches value labels; attaches field labels as variable labels  
> > > > and notes; and merges repeat groups.
> > > > 
> > > > The help file is extensive, but questions, concerns, and  
> > > > suggestions may be sent directly to my email address.
> > > > 
> > > > Thanks again to all who helped test the program,  
> > > > Lindsey, Matt and IPA
> > > > 
> > > > On Fri, Dec 20, 2013 at 11:46 AM, Lindsey Shaughnessy \< [lshaug...@poverty-action.org](mailto:lshaug...@poverty-action.org)\> wrote:
> > > > 
> > > > Hi ODK Community,
> > > > 
> > > > At IPA, our statistical package of choice is Stata -- and,  
> > > > increasingly, our survey platform of choice is ODK. So, we've written a  
> > > > Stata program, called -odkmeta-, that reads your xlsform in order to  
> > > > automatically generate a Stata do-file that produces one very clean,  
> > > > well-labeled, analysis-ready Stata dataset -- even if you are using repeat  
> > > > groups.
> > > > 
> > > > Why are we messaging this group? If you are an ODK and Stata user, we'd  
> > > > love for you to test -odkmeta- before we publicly release the program!
> > > > 
> > > > More specifically on the program's functionality, -odkmeta- reads the  
> > > > survey and choices worksheets of your xlsform and generates a do file  
> > > > which:
> > > > 
> > > > ```
> > > > o Imports lists as value labels
> > > > o Adds other values to value labels
> > > > 
> > > > o Imports ODK field attributes as characteristics
> > > > 
> > > > o Splits select_multiple variables
> > > > o Drops note variables
> > > > 
> > > > o Formats dates, time, and datetime variables
> > > > o Attaches field labels as variable labels and notes
> > > > 
> > > > o Attaches value labels
> > > > o Merges repeat groups
> > > > 
> > > > ```
> > > > 
> > > > After select\_multiple variables have been split, tasks can be removed  
> > > > from the do-file without affecting other tasks. User-written supplements to  
> > > > the do-file may make use of any field attributes, which are imported as  
> > > > characteristics. An extensive Stata help file outlines simple adjustments  
> > > > that you, as the end-user, can make to the resulting do-file in case of  
> > > > errors related to non-ODKstandard csv data files (e.g. varying date-time  
> > > > formats). We are also hoping to further improve the program's help file  
> > > > through our interactions with you.
> > > > 
> > > > Please see attached for a package of files that demonstrate -odkmeta-  
> > > > functionality: an example xlsform, dummy csv data files, the Stata do-file  
> > > > automatically generated by -odkmeta-, and the Stata dataset that was  
> > > > created by this do-file. The program itself, and the help file, are also  
> > > > included, so that you can run the program yourself on your own forms and  
> > > > data.
> > > > 
> > > > We have extensively tested -odkmeta- and intend to release it publicly  
> > > > on SSC in January, but are first looking to see how well the program works  
> > > > with any additional real-world forms we can, especially if those forms are  
> > > > complex. Please feel free to email me directly if you have trouble running  
> > > > the program, if you discover any bugs, or if you would like some assistance  
> > > > modifying your do-file. And please also email me directly if you are able  
> > > > to successfully run the program!
> > > > 
> > > > And finally, a preemptive statement. Here are some things we don't  
> > > > intend to do, at least at the moment: write a similar program that reads  
> > > > XML rather than XLSForms; write a similar program for R or SPSS; or  
> > > > overhaul the program to handle ever-changing quirks of the way  
> > > > certain ODK-based services handle output csv data (e.g. Formhub's n/a  
> > > > values). If you are looking to automatically generate Stata do-files from  
> > > > your XML (or from your XLSForm, and for other great features), we recommend  
> > > > you set up an account with SurveyCTO.
> > > > 
> > > > Thanks in advance for helping us to complete our final tests of  
> > > > -odkmeta-!
> > > > 
> > > > Lindsey, Matt, and IPA
> > > > 
> > > > --  
> > > > Lindsey Shaughnessy  
> > > > Data Coordinator  
> > > > Innovations for Poverty Action
> > > > 
> > > > --  
> > > > Lindsey Shaughnessy  
> > > > Data Coordinator  
> > > > Innovations for Poverty Action
> > > > 
> > > > Mobile: +1 508 932 6435
> > > > 
> > > > Skype: lindsey.shaughnessy
> > > > 
> > > > Email: [lshaug...@poverty-action.org](mailto:lshaug...@poverty-action.org)
> > > > 
> > > > --
> > > > 
> > > > --
> > > > 
> > > > Post: [opend...@googlegroups.com](mailto:opend...@googlegroups.com)
> > > > 
> > > > Unsubscribe: [opendatakit...@googlegroups.com](mailto:opendatakit...@googlegroups.com)
> > > > 
> > > > Options: [http://groups.google.com/group/opendatakit?hl=en](http://groups.google.com/group/opendatakit?hl=en)
> > > > 
> > > > * * *
> > > > 
> > > > You received this message because you are subscribed to the Google  
> > > > Groups "ODK Community" group.
> > > > 
> > > > To unsubscribe from this group and stop receiving emails from it, send  
> > > > an email to [opendatakit...@googlegroups.com](mailto:opendatakit...@googlegroups.com).
> > > > 
> > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > > > 
> > > > --  
> > > > Mitch Sundt  
> > > > Software Engineer  
> > > > University of Washington  
> > > > [mitche...@gmail.com](mailto:mitche...@gmail.com)
> > > > 
> > > > --
> > > > 
> > > > --
> > > > 
> > > > Post: [opend...@googlegroups.com](mailto:opend...@googlegroups.com)
> > > > 
> > > > Unsubscribe: [opendatakit...@googlegroups.com](mailto:opendatakit...@googlegroups.com)
> > > > 
> > > > Options: [http://groups.google.com/group/opendatakit?hl=en](http://groups.google.com/group/opendatakit?hl=en)
> > > > 
> > > > * * *
> > > > 
> > > > You received this message because you are subscribed to the Google  
> > > > Groups "ODK Community" group.
> > > > 
> > > > To unsubscribe from this group and stop receiving emails from it, send  
> > > > an email to [opendatakit...@googlegroups.com](mailto:opendatakit...@googlegroups.com).
> > > > 
> > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > > > 
> > > > --  
> > > > Lindsey Shaughnessy  
> > > > Data Coordinator  
> > > > Innovations for Poverty Action
> > > > 
> > > > Mobile: +1 508 932 6435
> > > > 
> > > > Skype: lindsey.shaughnessy
> > > > 
> > > > Email: [lshaug...@poverty-action.org](mailto:lshaug...@poverty-action.org)
> > > > 
> > > > --
> > > > 
> > > > --
> > > > 
> > > > Post: [opend...@googlegroups.com](mailto:opend...@googlegroups.com)
> > > > 
> > > > Unsubscribe: [opendatakit...@googlegroups.com](mailto:opendatakit...@googlegroups.com)
> > > > 
> > > > Options: [http://groups.google.com/group/opendatakit?hl=en](http://groups.google.com/group/opendatakit?hl=en)
> > > > 
> > > > * * *
> > > > 
> > > > You received this message because you are subscribed to the Google  
> > > > Groups "ODK Community" group.
> > > > 
> > > > To unsubscribe from this group and stop receiving emails from it, send  
> > > > an email to [opendatakit...@googlegroups.com](mailto:opendatakit...@googlegroups.com).
> > > > 
> > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > > > 
> > > > --  
> > > > Lindsey Shaughnessy  
> > > > Data Coordinator  
> > > > Innovations for Poverty Action
> > > > 
> > > > Mobile: +1 508 932 6435  
> > > > Skype: lindsey.shaughnessy
> > > > 
> > > > Email: [lshaug...@poverty-action.org](mailto:lshaug...@poverty-action.org)
> > > 
> > > --  
> > > --  
> > > Post: [opendatakit@googlegroups.com](mailto:opendatakit@googlegroups.com)  
> > > Unsubscribe: [opendatakit+unsubscribe@googlegroups.com](mailto:opendatakit+unsubscribe@googlegroups.com)  
> > > Options: [http://groups.google.com/group/opendatakit?hl=en](http://groups.google.com/group/opendatakit?hl=en)
> > 
> > * * *
> > 
> > You received this message because you are subscribed to the Google Groups  
> > "ODK Community" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [opendatakit+unsubscribe@googlegroups.com](mailto:opendatakit+unsubscribe@googlegroups.com).  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> Lindsey Shaughnessy  
> Data Coordinator  
> Innovations for Poverty Action
> 
> Mobile: +1 508 932 6435  
> Skype: lindsey.shaughnessy  
> Email: [lshaughnessy@poverty-action.org](mailto:lshaughnessy@poverty-action.org)

---

<div class="post-metadata">

**Author:** ![Kate\_Schneider](https://getodk.b-cdn.net/letter_avatar_proxy/v4/letter/k/e0b2c6/32.png) [@Kate\_Schneider](https://forum.getodk.org/u/Kate_Schneider)\
**Post date:** [August 8, 2017, 2:06am UTC](https://forum.getodk.org/t/new-resource-available-stata-program-for-handling-odk-forms-and-data/2787/22 "2017-08-08T02:06:59Z")

</div>

Hi Andeeb,  
I tried your fix on my similar problem but it didn't work. I used Kobotoolbox and not ODK Aggregate and I'm not sure the same fix works. Did you ever figure out a more generic solution that I could try?

(I posted my code and more explanation of the error as a new post for more detail)

Thanks!  
-Kate

---

<div class="post-metadata">

**Author:** ![Adeeb\_Choudhury](https://getodk.b-cdn.net/letter_avatar_proxy/v4/letter/a/b782af/32.png) [@Adeeb\_Choudhury](https://forum.getodk.org/u/Adeeb_Choudhury)\
**Post date:** [August 8, 2017, 2:43am UTC](https://forum.getodk.org/t/new-resource-available-stata-program-for-handling-odk-forms-and-data/2787/23 "2017-08-08T02:43:28Z")

</div>

Dear Kate,

Unfortunately, no, I never did figure out a more generic solution.

Good luck!

---

<div class="post-metadata">

**Author:** ![Amanda\_Berman](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/amanda_berman/32/2308_2.png) [@Amanda\_Berman](https://forum.getodk.org/u/Amanda_Berman)\
**Post date:** [August 31, 2017, 5:56pm UTC](https://forum.getodk.org/t/new-resource-available-stata-program-for-handling-odk-forms-and-data/2787/24 "2017-08-31T17:56:30Z")

</div>

Did you ever figure this out? I get the error "column header type not found" rather than list name... my column header is already named type so not sure what to do.

---

<div class="post-metadata">

**Author:** ![LN](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/ln/32/1605_2.png) [@LN](https://forum.getodk.org/u/LN)\
**Post date:** [November 14, 2017, 6:32pm UTC](https://forum.getodk.org/t/new-resource-available-stata-program-for-handling-odk-forms-and-data/2787/25 "2017-11-14T18:32:52Z")

</div>

6 posts were split to a new topic: [Odkmeta: “column header type not found”](https://forum.getodk.org/t/odkmeta-column-header-type-not-found/10617)

---

<div class="post-metadata">

**Author:** ![LN](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/ln/32/1605_2.png) [@LN](https://forum.getodk.org/u/LN)\
**Post date:** [November 14, 2017, 6:35pm UTC](https://forum.getodk.org/t/new-resource-available-stata-program-for-handling-odk-forms-and-data/2787/31 "2017-11-14T18:35:57Z")

</div>

9 posts were split to a new topic: [Odkmeta input csv format](https://forum.getodk.org/t/odkmeta-input-csv-format/10618)

---

<div class="post-metadata">

**Author:** ![Matthew\_White](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/matthew_white/32/1654_2.png) [@Matthew\_White](https://forum.getodk.org/u/Matthew_White)\
**Post date:** [November 14, 2017, 6:39pm UTC](https://forum.getodk.org/t/new-resource-available-stata-program-for-handling-odk-forms-and-data/2787/32 "2017-11-14T18:39:41Z")

</div>

We're glad that folks continue to find `odkmeta` helpful! If you have a new question about `odkmeta`, please ask it in a new thread: that helps the threads stay organized. Of course, feel free to link to this thread in your new thread!

---

<div class="post-metadata">

**Author:** ![LN](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/ln/32/1605_2.png) [@LN](https://forum.getodk.org/u/LN)\
**Post date:** [November 14, 2017, 6:42pm UTC](https://forum.getodk.org/t/new-resource-available-stata-program-for-handling-odk-forms-and-data/2787/33 "2017-11-14T18:42:04Z")

</div>



[Previous page](https://forum.getodk.org/t/new-resource-available-stata-program-for-handling-odk-forms-and-data/2787.md?page=1)
