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

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

From |
Maarten Buis <maartenlbuis@gmail.com> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: matrix of initial values in ml estimations |

Date |
Tue, 10 Apr 2012 16:00:18 +0200 |

On Tue, Apr 10, 2012 at 3:38 PM, Anisa Shyti wrote: > I would like to test a series of initial values for my coefficient > estimates in maximum likelihood. For this particular estimation, I > have two parameters, which values for both may fall in the range (0 > ,1). > > How can I define a matrix that tests for all the possible initial > values (eg., 0.1, 0.2, 0.3, ...., 0.9) for both parameters? The details depend on the exact program you are using but you'll probably end up using a nested loop, e.g. forvalues i = 1/9 { forvalues j = 1/9 { local a = `i'/10 local b = `j'/10 ... , from( /a=`a' /b=`b') ... } } Notice that it is generally good practice to code -forvalues i = 1/9- and inside the loop divide `i' by 10 instead of -forvalues i = 0.1(0.1).9-. The reason is that a computer works in binary and in binary the number 0.1 is like 1/3 in decimal. Hope this helps, Maarten -------------------------- Maarten L. Buis Institut fuer Soziologie Universitaet Tuebingen Wilhelmstrasse 36 72074 Tuebingen Germany http://www.maartenbuis.nl -------------------------- * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

**Follow-Ups**:**Re: st: matrix of initial values in ml estimations***From:*Anisa Shyti <anisa.shyti@gmail.com>

**References**:**st: matrix of initial values in ml estimations***From:*Anisa Shyti <anisa.shyti@gmail.com>

- Prev by Date:
**st: rollreg, gaps** - Next by Date:
**st: meanonly** - Previous by thread:
**st: matrix of initial values in ml estimations** - Next by thread:
**Re: st: matrix of initial values in ml estimations** - Index(es):