Thinking about writing an Excel macro to create a data labeling do-file

Hello all,

I have been googling around a bit and have failed to find a good solution
to get my ODK data into STATA with value labels. If I missed anything,
please let me know.

I use XLSform, so I have all data needed available in a structured format,
so it should not be so difficult to write a little macro that creates a
do-file that labels my data.

My VBA skills are primitive to say the least (I taught myself whatever I
needed over the past few years), so I figured: if there's anyone out there
who is also interested in a thing like this, and knows VBA better than I
do, they might review the code I come up. That way I have a: my data in a
more usable format. b: learned a thing or two on proper coding in VBA c:
provided other people with a tool they can use.

I am currently developing my survey, so somewhere in the next few weeks
looking at data starts getting important, and I'll have to start thinking a
bit more on this and I'll be able to provide a small excel file with the
macro.

Cheers,
Koen

Hi Koen - the KoBoToolbox formbuilder (www.kobotoolbox.org) offers a
function to export variable names and values to SPSS - we hope to support
other formats soon, but in the meantime, it is easy to import this
structure from SPSS to Stata.
The forms generated by XLSform are compatible with the formbuilder (select
menu/load from text).

Once your form is loaded you can export labels and values - You can learn
about this function by watching the instructional video at
http://www.kobotoolbox.org/videos - go to menu, SPSS/ create SPSS file

Of course other "label/value generators" would be very useful!

Good luck!

Patrick

··· On Sat, May 25, 2013 at 10:06 AM, Koen wrote:

Hello all,

I have been googling around a bit and have failed to find a good solution
to get my ODK data into STATA with value labels. If I missed anything,
please let me know.

I use XLSform, so I have all data needed available in a structured format,
so it should not be so difficult to write a little macro that creates a
do-file that labels my data.

My VBA skills are primitive to say the least (I taught myself whatever I
needed over the past few years), so I figured: if there's anyone out there
who is also interested in a thing like this, and knows VBA better than I
do, they might review the code I come up. That way I have a: my data in a
more usable format. b: learned a thing or two on proper coding in VBA c:
provided other people with a tool they can use.

I am currently developing my survey, so somewhere in the next few weeks
looking at data starts getting important, and I'll have to start thinking a
bit more on this and I'll be able to provide a small excel file with the
macro.

Cheers,
Koen

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: 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.
For more options, visit https://groups.google.com/groups/opt_out.

So I started working on this again (I've been busy doing other stuff).

I made a rough first excel file that manages to turn the XLSForm of a
fairly large questionnaire I have into STATA do files to label the data. It
is attached to this post.

I am posting mainly for anyone with some VBA experience to have a look at
it and identify points to improve, and errors in the code. Since I have no
formal training whatsoever in any programming, I can not offer any
guarantees on this macro working for you.

Koen

Label data.xlsm (29.1 KB)

··· On Saturday, May 25, 2013 3:50:31 PM UTC+1, Patrick Vinck wrote: > > Hi Koen - the KoBoToolbox formbuilder (www.kobotoolbox.org) offers a > function to export variable names and values to SPSS - we hope to support > other formats soon, but in the meantime, it is easy to import this > structure from SPSS to Stata. > The forms generated by XLSform are compatible with the formbuilder (select > menu/load from text). > > Once your form is loaded you can export labels and values - You can learn > about this function by watching the instructional video at > http://www.kobotoolbox.org/videos - go to menu, SPSS/ create SPSS file > > Of course other "label/value generators" would be very useful! > > Good luck! > > Patrick > > > On Sat, May 25, 2013 at 10:06 AM, Koen <koen.l...@gmail.com >wrote: > >> Hello all, >> >> I have been googling around a bit and have failed to find a good solution >> to get my ODK data into STATA with value labels. If I missed anything, >> please let me know. >> >> I use XLSform, so I have all data needed available in a structured >> format, so it should not be so difficult to write a little macro that >> creates a do-file that labels my data. >> >> My VBA skills are primitive to say the least (I taught myself whatever I >> needed over the past few years), so I figured: if there's anyone out there >> who is also interested in a thing like this, and knows VBA better than I >> do, they might review the code I come up. That way I have a: my data in a >> more usable format. b: learned a thing or two on proper coding in VBA c: >> provided other people with a tool they can use. >> >> I am currently developing my survey, so somewhere in the next few weeks >> looking at data starts getting important, and I'll have to start thinking a >> bit more on this and I'll be able to provide a small excel file with the >> macro. >> >> Cheers, >> Koen >> -- >> -- >> Post: opend...@googlegroups.com >> Unsubscribe: opendatakit...@googlegroups.com >> Options: 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 . >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > >

For what it's worth, SurveyCTO (www.surveycto.com) outputs Stata .do file
templates for you, including formatting dates and times, making sure that
numbers come in as numeric, reshaping and merging repeat-group data, etc.

Best,

Chris

··· On Thu, Dec 19, 2013 at 7:21 AM, Koen wrote:

So I started working on this again (I've been busy doing other stuff).

I made a rough first excel file that manages to turn the XLSForm of a
fairly large questionnaire I have into STATA do files to label the data. It
is attached to this post.

I am posting mainly for anyone with some VBA experience to have a look at
it and identify points to improve, and errors in the code. Since I have no
formal training whatsoever in any programming, I can not offer any
guarantees on this macro working for you.

Koen

On Saturday, May 25, 2013 3:50:31 PM UTC+1, Patrick Vinck wrote:

Hi Koen - the KoBoToolbox formbuilder (www.kobotoolbox.org) offers a
function to export variable names and values to SPSS - we hope to support
other formats soon, but in the meantime, it is easy to import this
structure from SPSS to Stata.
The forms generated by XLSform are compatible with the formbuilder
(select menu/load from text).

Once your form is loaded you can export labels and values - You can
learn about this function by watching the instructional video at
http://www.kobotoolbox.org/videos - go to menu, SPSS/ create SPSS file

Of course other "label/value generators" would be very useful!

Good luck!

Patrick

On Sat, May 25, 2013 at 10:06 AM, Koen koen.l...@gmail.com wrote:

Hello all,

I have been googling around a bit and have failed to find a good
solution to get my ODK data into STATA with value labels. If I missed
anything, please let me know.

I use XLSform, so I have all data needed available in a structured
format, so it should not be so difficult to write a little macro that
creates a do-file that labels my data.

My VBA skills are primitive to say the least (I taught myself whatever I
needed over the past few years), so I figured: if there's anyone out there
who is also interested in a thing like this, and knows VBA better than I
do, they might review the code I come up. That way I have a: my data in a
more usable format. b: learned a thing or two on proper coding in VBA c:
provided other people with a tool they can use.

I am currently developing my survey, so somewhere in the next few weeks
looking at data starts getting important, and I'll have to start thinking a
bit more on this and I'll be able to provide a small excel file with the
macro.

Cheers,
Koen

--
Post: opend...@googlegroups.com
Unsubscribe: opendatakit...@googlegroups.com

Options: 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.

For more options, visit https://groups.google.com/groups/opt_out.

--
--
Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: 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.
For more options, visit https://groups.google.com/groups/opt_out.

Koen

Since you're already using XLSForm, perhaps you could take a look at
Formhub. It now includes an R (and open source alternative to Stata)
library that is working and available to make short work of this, thanks to
Prabhas.

/r

··· On Thursday, December 19, 2013, Christopher Robert wrote:

For what it's worth, SurveyCTO (www.surveycto.com) outputs Stata .do file
templates for you, including formatting dates and times, making sure that
numbers come in as numeric, reshaping and merging repeat-group data, etc.

Best,

Chris

On Thu, Dec 19, 2013 at 7:21 AM, Koen koen.leuveld@gmail.com wrote:

So I started working on this again (I've been busy doing other stuff).

I made a rough first excel file that manages to turn the XLSForm of a
fairly large questionnaire I have into STATA do files to label the data. It
is attached to this post.

I am posting mainly for anyone with some VBA experience to have a look at
it and identify points to improve, and errors in the code. Since I have no
formal training whatsoever in any programming, I can not offer any
guarantees on this macro working for you.

Koen

On Saturday, May 25, 2013 3:50:31 PM UTC+1, Patrick Vinck wrote:

Hi Koen - the KoBoToolbox formbuilder (www.kobotoolbox.org) offers a
function to export variable names and values to SPSS - we hope to support
other formats soon, but in the meantime, it is easy to import this
structure from SPSS to Stata.
The forms generated by XLSform are compatible with the formbuilder (select
menu/load from text).

Once your form is loaded you can export labels and values - You can learn
about this function by watching the instructional video at
http://www.kobotoolbox.org/videos - go to menu, SPSS/ create SPSS file

Of course other "label/value generators" would be very useful!

Good luck!

Patrick

On Sat, May 25, 2013 at 10:06 AM, Koen koen.l...@gmail.com wrote:

Hello all,

I have been googling around a bit and have failed to find a good solution
to get my ODK data into STATA with value labels. If I missed anything,
please let me know.

I use XLSform, so I have all data needed available in a structured format,
so it should not be so difficult to write a little macro that creates a
do-file that labels my data.

My VBA skills are primitive to say the least (I taught myself whatever I
needed over the past few years), so I figured: if there's anyone out there
who is also interested in a thing like this, and knows VBA better than I
do, they might review the code I come up. That way I have a: my data in a
more usable format. b: learned a thing or two on proper coding in VBA c:
provided other people with a tool they can use.

I am currently developing my survey, so somewhere in the next few weeks
looking at data starts getting important, and I'll have to start thinking a
bit more on this and I'll be able to provide a small excel file with the
macro.

Cheers,
Koen

--
Post: opend...@googlegroups.com
Unsubscribe: opendatakit...@googlegroups.com

Options: 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.

For more options, visit https://groups.google.com/groups/opt_out.

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: 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

--

Nik
Need help customizing Survey Instruments/Tools/Forms for ODK Collect? Drop
me an email.

Thanks, I had not seen this yet.

The macro works for the dataset I have now, but in the future I'll have a
look at this, assuming it's easy to transfer data between R and STATA.

koen

··· On Thursday, December 19, 2013 1:51:17 PM UTC+1, ニコノコ wrote: > > Koen > > Since you're already using XLSForm, perhaps you could take a look at > Formhub. It now includes an R (and open source alternative to Stata) > library that is working and available to make short work of this, thanks to > Prabhas. > > /r > > On Thursday, December 19, 2013, Christopher Robert wrote: > >> For what it's worth, SurveyCTO (www.surveycto.com) outputs Stata .do >> file templates for you, including formatting dates and times, making sure >> that numbers come in as numeric, reshaping and merging repeat-group data, >> etc. >> >> Best, >> >> Chris >> >> >> >> On Thu, Dec 19, 2013 at 7:21 AM, Koen wrote: >> >> So I started working on this again (I've been busy doing other stuff). >> >> I made a rough first excel file that manages to turn the XLSForm of a >> fairly large questionnaire I have into STATA do files to label the data. It >> is attached to this post. >> >> I am posting mainly for anyone with some VBA experience to have a look at >> it and identify points to improve, and errors in the code. Since I have no >> formal training whatsoever in any programming, I can not offer any >> guarantees on this macro working for you. >> >> Koen >> >> >> >> On Saturday, May 25, 2013 3:50:31 PM UTC+1, Patrick Vinck wrote: >> >> Hi Koen - the KoBoToolbox formbuilder (www.kobotoolbox.org) offers a >> function to export variable names and values to SPSS - we hope to support >> other formats soon, but in the meantime, it is easy to import this >> structure from SPSS to Stata. >> The forms generated by XLSform are compatible with the formbuilder >> (select menu/load from text). >> >> Once your form is loaded you can export labels and values - You can >> learn about this function by watching the instructional video at >> http://www.kobotoolbox.org/videos - go to menu, SPSS/ create SPSS file >> >> Of course other "label/value generators" would be very useful! >> >> Good luck! >> >> Patrick >> >> >> On Sat, May 25, 2013 at 10:06 AM, Koen wrote: >> >> Hello all, >> >> I have been googling around a bit and have failed to find a good solution >> to get my ODK data into STATA with value labels. If I missed anything, >> please let me know. >> >> I use XLSform, so I have all data needed available in a structured >> format, so it should not be so difficult to write a little macro that >> creates a do-file that labels my data. >> >> My VBA skills are primitive to say the least (I taught myself whatever I >> needed over the past few years), so I figured: if there's anyone out there >> who is also interested in a thing like this, and knows VBA better than I >> do, they might review the code I come up. That way I have a: my data in a >> more usable format. b: learned a thing or two on proper coding in VBA c: >> provided other people with a tool they can use. >> >> I am currently developing my survey, so somewhere in the next few weeks >> looking at data starts getting important, and I'll have to start thinking a >> bit more on this and I'll be able to provide a small excel file with the >> macro. >> >> Cheers, >> Koen >> -- >> -- >> Post: opend...@googlegroups.com >> Unsubscribe: opendatakit...@googlegroups.com >> >> Options: 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. >> >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> >> >> -- >> -- >> Post: opendatakit@googlegroups.com >> Unsubscribe: opendatakit+unsubscribe@googlegroups.com >> Options: 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 >> >> > > -- > -- > Nik > Need help customizing Survey Instruments/Tools/Forms for ODK Collect? Drop > me an email. > >

Hi Koen,

A Stata program for producing -do- files is available for beta testing.

If you haven't seen it already, refer to this thread
https://groups.google.com/forum/m/#!topic/opendatakit/CUctlo9nVkk

The program will be freely available on Stata's SSC once testing is done. We welcome comments and suggestions.