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]
Re: st: Problems with expand og reverting to original dataset
From
Ada Ma <[email protected]>
To
[email protected]
Subject
Re: st: Problems with expand og reverting to original dataset
Date
Thu, 20 Jan 2011 17:01:20 +0000
Hi Grethe
WRT your Q to Nick the command you should write is:
bysort mother_id father_id (birth_date) : gen diff = birth_date[_n+1]
-birth_date
With more than one sibling I guess you need to choose the one who have
the most "within 5 years" as the index sibling.
What regression are you trying to run? Others might have better
suggestions how to set up your data set depending on what regressions
you are going to run.
Regards,
Ada
On Thu, Jan 20, 2011 at 2:12 PM, Grethe Søndergaard
<[email protected]> wrote:
> Thank you for your answers
>
> @ Nick Cox: I have tried to run bysort mother_id father_id
> (birth_date) : gen diff = birth_date[2] -birth_date[1]. However, an
> error message appear: "factor variables and time-series operators not
> allowed". Can I solve this problem - by somehow changing the type of
> variable that birth_date is?
>
> @ Ada Ma: My dataset consists of more than two siblings per family
> (one line for each person). I am not sure how to find out which
> siblings to be included in the dataset, if more than two siblings are
> being compared. E.g. a family consists of children age 1, 4, and 8 (so
> who should stay in the dataset). So that is why I choose only to
> include persons with one siblings.
>
>
>
> 2011/1/20 Nick Cox <[email protected]>:
>> Nick
>>
>> On Thu, Jan 20, 2011 at 1:28 PM, Ada Ma <[email protected]> wrote:
>>> How does your original dataset looks like?
>>>
>>> One line of data per person or one line of data per pair of siblings?
>>> Do you always have 2 siblings or do you have more than 2 siblings?
>> *
>> * 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/
>
--
Ada Ma
Research Fellow
Health Economics Research Unit
University of Aberdeen, UK.
http://www.abdn.ac.uk/heru/
Tel: +44 (0) 1224 555189
Fax: +44 (0) 1224 550926
*
* 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/