Statalist The Stata Listserver


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

Re: st: store tabulate data


From   "Friedrich Huebler" <[email protected]>
To   [email protected]
Subject   Re: st: store tabulate data
Date   Tue, 12 Jun 2007 14:06:29 -0400

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/



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