Statalist


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

Re: st: AW: creating two groups with identical distribution of one variable


From   Michael McCulloch <[email protected]>
To   [email protected]
Subject   Re: st: AW: creating two groups with identical distribution of one variable
Date   Wed, 14 Oct 2009 13:56:47 -0700

Sorry Martin, yes I intended to say equal to each other, as in:

"I'm seeking some guidance on how to create variable newgroup,  such  
that newgroup A and B will be equal to each other in age distribution."



On Oct 14, 2009, at 1:46 PM, Martin Weiss wrote:

>
> <>
>
> " such that newgroup A and B will have equal age distribution"
>
>
>
> What do you mean? "Equal" to what? To each other or to groups "1"  
> and "2"?
>
>
>
> HTH
> Martin
>
>
> -----Ursprüngliche Nachricht-----
> Von: [email protected]
> [mailto:[email protected]] Im Auftrag von Michael
> McCulloch
> Gesendet: Mittwoch, 14. Oktober 2009 22:41
> An: Statalist Statalist
> Betreff: st: creating two groups with identical distribution of one  
> variable
>
> Hello Statalist folks,
> Using the following simulation, I create two groups: #1 = mean age 50,
> #2 = mean age 60.
> I'm seeking some guidance on how to create variable newgroup, such
> that newgroup A and B will have equal age distribution.
>
> clear
> set obs 1000
> gen group=1
> replace group=2 in 501/1000
> gen id=_n
> set seed 12358
> gen age = 50+10 * invnorm(uniform()) if group==1
> replace age = 60+10 * invnorm(uniform()) if group==2
> hist age, by(group)
>
>
>
> Michael McCulloch
> Pine Street Foundation
> 124 Pine Street
> San Anselmo, CA 94960-2674
> tel:	415-407-1357
> fax: 	206-338-2391
> [email protected]
>
>
>
>
>
>
> *
> *   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/



Michael McCulloch
Pine Street Foundation
124 Pine Street
San Anselmo, CA 94960-2674
tel:	415-407-1357
fax: 	206-338-2391
[email protected]









*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index