Statalist The Stata Listserver


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

st: "table" command with weight


From   "FUKUGAWA, N." <[email protected]>
To   [email protected]
Subject   st: "table" command with weight
Date   Tue, 16 Jan 2007 20:42:11 +0900

dear all,
i need to aggregate the data using weight.

the original data
cat	catid	x	weight
1	1	a	.33
1	2	a	.33
1	3	b	.33
2	1	c	.5
2	2	a	.5
3	1	d	1
4	1	c	.25
4	2	d	.25
4	3	b	.25
4	1	c	.25

the aggregated data
x	freq
a	1.166(=.33+.33+.5)
b	.58(=.33+.25)
c	1(=.5+.25+.25)
d	1.25(=1+.25)

please note i need to create weight (the proportion within the
category) because it does not exist in the original data.
this is to avoid double counting.
the number of rows is 9m.
the number of variables is 100.
thank you in advance.
--
FUKUGAWA Nobuya, Ph.D.
[email protected]

*
*   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