Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

Re: st: rearranging small sets of data and rows to columns


From   Charles Vinis <charles.vinis@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: rearranging small sets of data and rows to columns
Date   Wed, 3 Aug 2011 13:25:22 -0400

Hey,

I just had to do a somewhat similar thing and there is a great command
you can use called "reshape" that does exactly what you're trying to
do. Here's a link that explains how to use it better than I can:

http://www.stata.com/support/faqs/data/reshape3.html

Also, if you look reshape up in help it has some more good examples
and explanations.

Good luck!

On Wed, Aug 3, 2011 at 9:33 AM, Doug Hess <douglasrhess@gmail.com> wrote:
> Hi.
>
> I am not sure if Stata is useful for doing the following and I'm not
> even sure what the vocabulary is for discussing this sort of
> rearranging of data. But here goes.
>
> A government agency gave me data in the following format (in a text
> file) and claims they cannot produce it any other way.  Bringing it
> into Stata (ver.11) was not hard, but now I need to rearrange it.
>
> Each office essentially is its own set of rows and columns. The
> columns are months and the rows are something like this (the question
> rows are just simple counts of yeses to a yes/no question):
>
> Office 1
> Number of clients seen
> Number refused survey
> Question 1
> Question 2
> Question 3
>
> Office 2
> Number of clients seen
> Number refused survey
> Question 1
> Question 2
> Question 3
>
> Etc. for ~60 offices
>
> So I'd like to rearrange it with offices as rows (records) and the
> columns as questions by month (with number of clients seen as "size"
> and number refusing to take the survey as "refused"). So the variables
> are: Jan11Size, Jan11Refuse, Jan11Q1 Jan11Q2...Feb11Size , Feb11Refuse
>  Feb11Q1, etc.
>
> Thoughts on how to do this? And are there terms of art for what kind
> of problem or method this is?
>
> Thank you.
>
> Doug
> *
> *   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index