Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: Creating a Count Variable


From   "Vargas Naranjo Isaac Alonso" <IVargasN@ice.go.cr>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Creating a Count Variable
Date   Thu, 3 Apr 2008 13:55:11 -0600

Puede hacerlo de la siguiente manera:

Gen newvar=vara+varb+varc+vard+vare

Le generará una nueva variable con la suma de las otras que me imagino deben estar codificadas como 0 y/o 1, el resultado será la suma de veces que fue seleccionado algún elemento.

Saludos,

Isaac A. Vargas Naranjo.
Gestión Financiera - División Clientes


-----Mensaje original-----
De: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] En nombre de Chao Yawo
Enviado el: jueves, 03 de abril de 2008 01:37 p.m.
Para: statalist@hsphsun2.harvard.edu
Asunto: st: Creating a Count Variable

Hi
 
I have a range of 5 variables that ask respondents
who is responsible for different household household
tasks (vara, varb, varc, vard, vare). Respondents
have a choice of selecting one fo the followinvg
responses/values for each question:
 
1. Respondent Alone,
2. Respondent and Roomate
3. Respondent and Someone else
4.Roomate Alone
5. Someone else alone.
 
I want to create a variable that counts how many
times a respondent selects each of these
values/responses/choices across all the five
variables (vara - vare).
 
The resulting output would list per respondent, how
many times they selected each choice (across the 5
variables).
 
thanks very much -- CY


      ____________________________________________________________________________________
You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost.  
http://tc.deals.yahoo.com/tc/blockbuster/text5.com
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index