Thanks a lot for all the comments and suggestions. It has helped me
solve the problem. I find the "wide" to "long" transformation of the
data especially helpful. I used this in STATA but was not aware that I
could do the same in R.
Deepankar
On Fri, 2007-10-26 at 08:44 -0500, Douglas Bates wrot
Another approach is to convert the data frame that you have in what is
sometimes called the "wide" format to the "long" format. See ?reshape
for details on this transformation.
In the process of doing the conversion I would also convert the sex of
the child to a factor with meaningful levels and
You might want to consider another representation, but it would depend
on how you want to use it. Here is a 'list' that records for each row
the position of the boys; does this start to give you the type of data
that you want? These are the numeric values of where the boys occur.
> x.m
b1 b
Hi All,
I have data on the sequence of births for families with completed
fertility cycle (in a data frame); the relevant variables are called b1,
b2, b3, b4, b5, b6 and record the birth of the first, second, ..., sixth
child. So,
b1=1 if the first birth is male,
b1=2 if the first birth is femal
4 matches
Mail list logo