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: generating a continuous sequence


From   Nick Cox <njcoxstata@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: generating a continuous sequence
Date   Wed, 17 Oct 2012 19:13:55 +0100

As is documented, -egen-'s -seq()- function is for integer sequences.
You don't need anything special for other sequences beyond
multiplication or division

Example 1

set obs 100
gen y = _n * 0.1

Example 2

gen y2 = _n / 10

Also, look at -range-

That said, -twoway function- in my experience makes this kind of
construction quite unnecessary.

Nick

On Wed, Oct 17, 2012 at 7:06 PM, Jason Rosenberg <RSNJAS002@myuct.ac.za> wrote:
> hi, I am trying to generate a continuous sequence in stata for curve drawing puposes.
>
> Now I have this:
>
> egen number = seq()
>
> but I would like increments of at least 0.5, 0.1 would be perfect.
> is this possible?
>
> I plan on using it in this equation:
> gen prob =  (v/gamma)*(beta^(2*alpha)/(number+t_zero)^(alpha+1))*exp(-(beta^2/(number+t_zero))^v)
> ### UNIVERSITY OF CAPE TOWN This e-mail is subject to the UCT ICT policies and e-mail disclaimer published on our website at http://www.uct.ac.za/about/policies/emaildisclaimer/ or obtainable from +27 21 650 9111. This e-mail is intended only for the person(s) to whom it is addressed. If the e-mail has reached you in error, please notify the author. If you are not the intended recipient of the e-mail you may not use, disclose, copy, redirect or print the content. If this e-mail is not related to the business of UCT it is sent by the sender in the sender's individual capacity. ###
>
>
> *
> *   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index