Bookmark and Share

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

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

Re: st: mata in program define

From   Maarten Buis <>
Subject   Re: st: mata in program define
Date   Tue, 5 Jul 2011 08:58:06 +0200

On Tue, Jul 5, 2011 at 5:35 AM, Zhi Su <> wrote:
>  I need to get bootstrap standard errors in a regression. And I need
> to define a program that produce the standdard errors for a single
> sample. When defining parts of the program that is involved with
> matrix calculation, mata is used.

You should store the Mata part in a function defined outside the Stata
program. Than within you Stata program you call that Mata function in
one line. So the basic structure would be:

void foo() {

program define foo
    mata: foo()

Hope this helps,

Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen

*   For searches and help try:

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