Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: data manipulating question


From   Richard Williams <Richard.A.Williams.5@nd.edu>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: data manipulating question
Date   Fri, 22 Oct 2004 23:03:25 -0500

At 05:48 PM 10/22/2004 -0700, Phuong Lan Nguyen wrote:
Dear Clive,

I forgot to mention that I used reshape command but then my sample size has increased to 3 times as new variable. That means, I have 3 values for every single household. I do not want to change sample size. I just want to have exact number of cases as before I do reshape. so what is the next step for getting that variable?

best,
Phuong
Phuong, perhaps you could clarify what you are trying to do. In the original example, you had one case with 3 variables. Like Clive, I thought you wanted to reshape it into 1 variable with 3 cases. Same amount of info but arranged differently. I don't see how you could do what you want without increasing the sample size, but maybe I misunderstand what it is you want.

Do you perhaps want to add the 3 variables together in such a way that a single variable will contain all the info that was in the 3? If, for example, the possible values of each variable run from 0 to 9, you could do something like

gen newvar = 100*var1 + 10*var2 + var3

Each possible 3-way combination of values would be uniquely identified this way.

-------------------------------------------
Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
FAX: (574)288-4373
HOME: (574)289-5227
EMAIL: Richard.A.Williams.5@ND.Edu
WWW (personal): http://www.nd.edu/~rwilliam
WWW (department): http://www.nd.edu/~soc

*
* 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