I can't seem to make this work.  Here is the example from the User's Guide

<hansl>
function matrix stata_reorder (matrix se)
 scalar n = rows(se)
return se[n] | se[1:n-1]
end function

open data4-1
ols 1 0 2 3 --cluster=bedrms
matrix se = $stderr

foreign language=stata --send-data
regress price sqft bedrms, vce(cluster bedrms)
matrix vcv = e(V)
gretl_export vcv "vcv.mat"
end foreign

matrix stata_vcv = mread("@dotdir/vcv.mat")
stata_se = stata_reorder(sqrt(diag(stata_vcv)))
matrix check = se - stata_se
print check
<\hansl>

There is something fishy about gretl_export.  I can't seem to get a matrix written to the dotdir directory (or anywhere else).  The data are created and loaded into Stata, the regression runs in the background, but vcv.mat is nowhere to be found. I'm using version Stata 12 on Windows. 

Am I missing something obvious?

Lee 
--
Lee Adkins
Professor of Economics
lee.adkins@okstate.edu

learneconometrics.com