[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: re: ML program and ML maximize help

From   Kit Baum <>
Subject   st: re: ML program and ML maximize help
Date   Mon, 8 Sep 2008 19:47:15 -0400

< >
global stock

program define lesmond
version 10.1
args todo b lnf
tempvar alpha1 alpha2 beta sigma last
mleval `alpha1' = `b', eq(1)
mleval `alpha2' = `b', eq(2)
mleval `beta' = `b', eq(3)
mleval `sigma' = `b', eq(4)
// MY_panel contains the panel ID
local by $stock
sort `by'

I don't think this has anything to do with ML. Your 'global stock' defines the macro $stock as empty, and then you say

local by $stock

which will cause the local to be empty, and then you

sort `by'

which evaluates to


It is true that sort requires a varlist. This is why you're getting a `varlist required' error. Define the stock macro as having some content and it should work (or at least give you a new, interesting error message).


Kit Baum, Boston College Economics and DIW Berlin
An Introduction to Modern Econometrics Using Stata:

* For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index