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]

Re: st: observation-level numerical integration


From   Nick Cox <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re: st: observation-level numerical integration
Date   Mon, 19 Aug 2013 14:38:34 +0100

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/


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