Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: New (simple) .net class library available for getting IEnumerable data into stata


From   "Brent McSharry (ADHB)" <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: New (simple) .net class library available for getting IEnumerable data into stata
Date   Tue, 4 Feb 2014 17:31:59 +1300

This is purely a tool for .net programmers who use Stata. Appologies to other statalisters.

https://github.com/mcshaz/BlowTrial/tree/master/GenericToDataFile

While StatTransfer can be a great tool, it does not transfer many data storage formats used by .net programmers (eg non ODBC databases such as sql server compact (CE) or non database storage such as XML).

I use these data storage forms to hold trial data, alongside .net interfaces such as MVC and WPF to validate data entry, but need a clean way to get the data into Stata for interim safety and final data analyses.

If someone else is in the same position, they are welcome to use/contribute to the (very simple and small) open source library on GitHub (which is working in all of my current scenarios, but has lots of room for further improvements).

Usage would be (c#)
IEnumerable<Participants> data = MyDataRepository.Participants.ToList();
String stataDoInstructions = GenericToDataString.ListConverters.ToStataDo<Participants>(data)

Output is similar to using the data editor, eg
.set obs 10
.generate double datetimevar
.format datetimevar %tc
.replace datetimevar=1704358560000000 in 1

Varable names are the same as the property names.

Brent McSharry MBBS BSc(med) FCICM(paed)
Paediatric Intensivist
Starship Children's Hospital
Private Bag 92024
Auckland 1142
New Zealand 


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index