Bookmark and Share

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]

st: Re: observation-level numerical integration


From   "Liu,Zhong" <[email protected]>
To   <[email protected]>
Subject   st: Re: observation-level numerical integration
Date   Mon, 19 Aug 2013 23:20:10 +0800

Dear Nick:

Thanks. I mean 'normal' - the cumulative standard normal distribution. The difference by substration is to obtain the welfare gain when the element of 'v1' is changed into the corresponding element of 'v2'.

But your kind answer has solved my problem.

Best,
Zhong

-----原始邮件----- From: Nick Cox
Sent: Monday, August 19, 2013 9:38 PM
To: [email protected]
Subject: Re: st: observation-level numerical integration

As -normal()- is itself the result of integration, I wonder whether
you mean what you say

gen v3 = normal(v2) - normal(v1)

may be what you seek. Otherwise put, the pertinent integral has
already been evaluated, and all you need is a subtraction.

For "STATA" read "Stata", throughout.

Nick
[email protected]

On 19 August 2013 14:20, Liu,Zhong <[email protected]> wrote:

In my project, I have the following integration issue. It will be much
appreciated if you can provide any help. The problem could be simplified as
below:

A dataset has two variables, say ‘v1’ and ‘v2’. Either of them has ‘N’ number of observations. I want to generate a third variable, say ‘v3’. The
1st element of ‘v3’ is the numerical integration with the 1st element of
‘v1’ as the lower limit to the integral and the 1st element of ‘v2’ as the
upper limit to the integral. Similarly, the 2nd element of ‘v3’ is the
numerical integration with the 2nd element of ‘v1’ as the lower limit to the
integral and the 2nd element of ‘v2’ as the upper limit. And so on. The
function integrand is known as ‘normal(x)’ – the cumulative standard normal
distribution defined by STATA.

I find the STATA command of ‘integ’ does not apply here.

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/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/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index