Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

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

Re: st: MLE for each day

From   Maarten buis <>
Subject   Re: st: MLE for each day
Date   Thu, 21 Oct 2010 10:44:43 +0100 (BST)

--- On Thu, 21/10/10, Beatrice Crozza wrote:
> I wrote a maximum likelihood with the lf method.
> Now, I want to tell Stata to do the maximum likelihood for
> each day in my sample (each day is divided in time intervals).
> How can I do this?
> I tried foreach at the beginning of the program but doesn'
> t work.

Doesn't work is not informative enough, we need to know 
exactly what you typed, what you expected Stata to return, 
and what Stata actually did return.

Given what you told us I can only give you this pseudo-code
that you might or might not be able to adjust to your 

levelsof day
foreach day in `r(varlist)' {
    ml model lf my_prog_lf (y=x) (x2) ... if day == `day', maximize

Hope this helps,

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


*   For searches and help try:

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