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

Re: st: data manipulating question


From   Phuong Lan Nguyen <[email protected]>
To   [email protected]
Subject   Re: st: data manipulating question
Date   Fri, 22 Oct 2004 17:48:16 -0700 (PDT)

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


On Sat, 23 Oct 2004, Clive Nicholas wrote:


Phuong Lan Nguyen wrote:

I have a question about stata program and I hope you are able to help me.
I
have a series of numeric variables and want to group them into 1
variable. Details of my data is

 	var1		var2		var3
 	x		y		z

3 variables indicates 3 code of teaching experience of teachers. Now i
want to
group them into 1 variable:

 	new variable
var1 	x
var2	y
var3	z

What command should I use to transform these variables?
If I were a betting man, I'd say -reshape- ought to do the job. Here's my
stab:

(1) Create a new column, place it to the extreme left and give that cell a
   name (let's call it -ugg-);

(2) Then:
   . reshape long new, i(ugg) j(var)

If I have it the right way around, that ought to do it.

CLIVE NICHOLAS        |t: 0(044)7903 397793
Politics              |e: [email protected]
Newcastle University  |http://www.ncl.ac.uk/geps
*
*   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/

---)*(---)*(---)*(---)*(---)*(---)*(---)*(---)*(---
Phuong Lan Nguyen
Department of Sociology
202 Savery, UW
Seattle WA 98195-3340
Tel: 206-543-9883
Email: [email protected]
Home page: http://students.washington.edu/phuong/
*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index