Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: store tabulate data


From   "bunny , lautloscrew.com" <[email protected]>
To   [email protected]
Subject   Re: st: store tabulate data
Date   Tue, 12 Jun 2007 23:17:16 +0200

Hi,

thx for your support.
in the meantime i found a solution.
the following worked for me.

sort hhnr
by hhnr: gen sibs=_N

to create a number of siblings column.

and the following was good for a birth order variable in my case:

sort hhnr agekids00
by hhnr: gen b_order=sibs-_n+1

maybe this could help other newbies...

thx for much for your help links and suggestions, i guess that�ll help a lot
in the future.

matthias

Am 12.06.2007 um 20:06 schrieb Friedrich Huebler:


Matthias,

First, it looks like you would benefit from reading the "Getting
started with Stata" guide.

You do not provide enough detail about the nature of your data, but
the following commands may provide the answer you are looking for.

gen siblings = 1
collapse (sum) siblings, by(householdnumber)
list

There is also a FAQ related to your problem of counting the siblings
in each household.

How do I create variables summarizing for each individual properties
of the other members of a group?
http://www.stata.com/support/faqs/data/members.html

Friedrich

On 6/12/07, bunny , lautloscrew.com <[email protected]> wrote:
Hi everybody,

i am really new to stata and work with R for a little while, so i
guess my problem is rather basic and rather a syntax problem.
i have a dataset with household numbers of kids and i want to get a
new "number of siblings" variable.
that means i�d like to store the frequency of household number just
right next to the household number itself.

my approach is to use tabulate householdnumber... which prints a
table of frequency and percentages.

Can I do it like that ? And how can I store this frequency as a
variable ? such that i can see it in the data editor as a column ?

in R something like A = tabulate householdnumber would have worked.
but in STATA it does not.
Somehow I used the wrong search phrases so far there must exist
something like it.

i have the same problem storing correlation matrices. mycorrmat = cor
a b c d  aint working neither.

thanks in advance !

matthias
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index