Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Drosophilia Melanogaster <mutilated_cadaver@yahoo.com> |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: st: re: Cumulative Accuracy Profile |
Date | Fri, 4 Feb 2011 12:01:42 +0800 (SGT) |
Thanks so much Joseph! I tried copying the pre-programmed equations in Stata but they don't work, until I realized the parameters b1 or k should be in brackets {} and not in parenthesis (). You're lucky you're not working with credit risk as it's such a pain in the arse. >=( Anyways, thanks again for your help and wish me luck! :) Mika -------------------------------------------------------------- Mika wrote: . . . I really have no idea how to program in Stata but ill give it a try nonetheless. -------------------------------------------------------------------------------- Take a look at the line of code just beneath the "Begin here" comment in the illustration below to get an idea of what to do. (The beginning of the illustration code just creates an artificial dataset to work with. I don't work in credit risk assessment, and so have no idea whether the fake data values and parameter choice are realistic or not.) You can refer to the help file for -nl- for further details on the syntax for the nonlinear least-squares regression estimation command, as Nick pointed out. Joseph Coveney version 11.1 clear * set more off set seed `=date("2011-03-03", "YMD")' set obs 250 generate double x = 100 * runiform() scalar define k = 0.5 generate double y = (1 - exp(-k * x)) / (1 - exp(-k)) + rnormal() * * Begin here * nl(y = (1 - exp(-{k} * x)) / (1 - exp(-{k}))), init(k 1) nolog exit * * 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/