Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: A problem with reshape


From   ofran almossawi <[email protected]>
To   [email protected]
Subject   st: A problem with reshape
Date   Sun, 14 Jul 2013 23:00:49 +0100

Hello
I am having some problems with reshape. my data set is rather large
and i cannot make the changes by hand.
I have data that have no unique identifier, see example of my data below:

id   disease   type

1     A              comorbidity
1     B              primary
1     C             comorbidity
2     D             primary
2     E              secondary
2     F             comorbidity
3     G             primary
3     H              comorbidity
3     I                comorbidity
3     J              comorbidity

the problem that i am having is creating comorbidity 1, 2, 3 etc and
reshaping the data into wide format.

I have followed the example at
http://www.stata.com/support/faqs/data-management/problems-with-reshape/

but when I get to the line "by group, sort: replace no = _n" I get a
"0 replacements made" message.

I am not sure where I am going wrong with this or if there is a better
way of doing it.

many thanks in advance.
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index