Plugins are here, see http://www.stata.com/support/plugins/.
I believe there is an error in the documentation for accessing the data
from a Stata plugin written in C. (This is rather technical, but will
save you time if you are experimenting with this new feature.) The
function with signature
ST_retcode SF_vdata(ST_int i, ST_int j, ST_double *z)
is supposed to "read the ith observation of variable j in varlist and
place this value in z", but i and j appear to be reversed: I think the
first argument denotes the variable and the second the observation. (BTW
both count from one, not zero).
To confirm this look at the rowsum.c example in the documentation, which
sums variables across rows. The sample code loops over observations
using j and over variables using k. The call to retrieve variable k for
observation j reads
SF_vdata(k,j,&z)
My own attempt to compute a mean didn't work until I reversed the
indices. This is a bit of a shame because obs,var seems more natural, at
least to me.
When it comes to matrices my spelunking shows that
ST_retcode SF_mat_el(char *mat, ST_int i, ST_int j, ST_double *z)
does indeed "take{s} the [i,j] element of Stata matrix mat and stores it
into z". So we have a bit of an inconsistency in the way matrices and
the data in memory are handled in terms of rows and columns.
Given that the plugin technology is so new I wonder if Stata could
change the SF_vdata (and presumably SF_vstore) interfaces to conform to
the documentation and maintain consistency between datasets and
matrices.
Cheers,
Germ�n Rodr�guez
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/