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 at the end of May, and its replacement, statalist.org is already up and running.


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

Re: st: Solving a System of Equation in Stata


From   "C.T. Shehzad" <C.T.Shehzad@rug.nl>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Solving a System of Equation in Stata
Date   Wed, 02 Jun 2010 16:35:27 +0200

Dear Austin:

Thanks for your help.

Yes, actually number of observations  is pretty large because e.g.
ustbill repeat in panels (2000firms*100mon). Unfortunately,  I am trying
to calculate the measure for each observation ! I corrected the vfs and
d1 but still it is having some problem. Do you think this program can
still help?

Thanks again,
Tanveer


Austin Nichols wrote:
> C.T. Shehzad <C.T.Shehzad@rug.nl>:
> Your program has a number of mistakes, e.g. `vfs' not a tempname and
> `svf' and `d1' not defined, but I doubt it will ever do what you
> want--do you have 150540 obs on a varlist (equity debt ustbill), and
> you want to calculate something for each observation separately?
> Perhaps you should lay out carefully what you are trying to do.
>
> On Wed, Jun 2, 2010 at 8:39 AM, C.T. Shehzad <C.T.Shehzad@rug.nl> wrote:
>   
>> Dear Maarten:
>>
>> Thanks for your reply.
>>
>> I tried to program using nl command but I get error. Apparently things
>> look in line with your suggested thread and stata help. can you spot
>> something that I am doing wrong? My program is blow.
>>
>> Thanks and best regards,
>>
>> Tanveer
>> . program nltanveer
>>  . syntax varlist (min=1 max=1) [if], at(name)
>>  . tempname vf svf zd1 zd2
>>  . scalar `vf' = `at'[1,1]
>>  . scalar `vfs' = `at'[1,2]
>>  . scalar `zd1' = `at'[1,3]
>>  . scalar `zd2' = `at'[1,4]
>>  . tempvar z545
>>  . gen double `z545' = [[equity +
>> (debt*(exp^(-ustbill))*normal(`zd2'))]/normal(`zd1')] + 1 - `vf' in 1
>>  . replace `z545' = (eqvol*equity)/[(`vf')*normal(`d1') - `svf' in 2
>>  . replace `z545' = [[log((`vf')/debt) + (ustbill + 0.5*
>> (`svf')^2)]/(`svf')] - `zd1' in 3
>>  . replace `z545' = `zd1' - `vfs' - `zd2' in 4
>>  . replace `varlist' = `z545'
>>  . end
>>
>> . set obs 150540
>> obs was 150540, now 150540
>> . gen y = 0
>> . replace y = 1 in 1
>> (1 real change made)
>> . nl tanveer @ y, parameters(vf svf zd1 zd2) initial (vf 1 svf 1 zd1 1
>> zd2 1)
>>
>> nltanveer returned 198
>> verify that nltanveer is a function evaluator program
>> r(198);
>>
>>
>> Maarten buis wrote:
>>     
>>> --- On Tue, 1/6/10, C.T. Shehzad wrote:
>>>
>>>       
>>>> I am trying to solve a system of equation in stata. I
>>>> understand how to do it in excel but its
>>>> implementation in stata looks problematic so your
>>>> help will be quite useful.
>>>>
>>>>         
>>> http://www.stata.com/support/faqs/lang/nl.html
>>>       
>
> *
> *   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/
>   


*
*   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/


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