Statalist


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

st: RE: generate composite variable with select values


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   st: RE: generate composite variable with select values
Date   Sat, 2 Jan 2010 21:58:04 +0100

<>

*************
clear*

set obs 100

gen byte BlindParticipants = irecode(runiform(),0,.2,.3,1)
gen byte BlindProviders    = irecode(runiform(),0,.2,.3,1)
gen byte BlindAssessors    = irecode(runiform(),0,.2,.3,1)
gen byte BlindAnalysts     = irecode(runiform(),0,.2,.3,1)
gen byte BlindSuccess      = irecode(runiform(),0,.2,.3,1)

egen byte threes = anycount(Blind*), values(3)
gen byte all=threes==5
*************


HTH
Martin

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Nikolaos Pandis
Sent: Samstag, 2. Januar 2010 18:51
To: [email protected]
Cc: [email protected]
Subject: st: generate composite variable with select values

Hi to all and Happy New Year.

I have 5 variables referring to blinding, all with 3 levels (1, 2, 3):

BlindParticipants
BlindProviders
BlindAssessors
BlindAnalysts
BlindSuccess

I would like to generate a composite variable that includes all 5 variables
that are ==3.

Many thanks in advance.

Nick


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