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, is already up and running.

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

st: reshape long and variables not being found

From   Nanlesta Pilgrim <>
Subject   st: reshape long and variables not being found
Date   Tue, 13 Jul 2010 18:03:53 -0400


My data set is compose of adolescents and their parents and is
currently in wide format.  Families are followed over 4 years.
Therefore I have many variables with the same name for parents and
adolescents with the suffix, "p," indicating  for parent.  For
example, the variable for HIV status of the adolescent and parent:

hiv2000 hiv2001 hiv2002 hiv2003 hivp2000 hivp2001 hivp2002 hivp2003.

In stata my code is:
reshape long hiv hivp, i(curr_id) j(years)

Stata returns:
variable hivp2000 not found

Of course there are several variables in the reshape command.  If I
simply use "hiv" and not hivp, then the dataset reshapes but my parent
variables do not reshape.  Additionally, some parent variables are
recognized while others are not.  Why aren't some of the parents'
variables being recognize?

*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index