Statalist


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

st: RE: generate


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: generate
Date   Sun, 29 Jul 2007 16:55:41 +0100

In addition to various other answers, see 

FAQ     . . . .  Generating variables relating panel data to a reference panel
        7/02    How can I generate a variable relating panel data
                to a reference panel?
                http://www.stata.com/support/faqs/stat/panelref.html

Having "total" information in the same dataset has one advantage
-- it is usually interesting -- and one big disadvantage --
you have to keep remembering to exclude it from most analyses. 

Nick 
[email protected] 

Issam.Hallak
 
> My dataset looks like this:
> 
> company_name	year	var1	var2	var3	...
> 
> firm_A			1990	3	2	5	...
> firm_A			1991	4	2.4	4.8	...
> firm_A			1992	4.2	3	5	...
> ...			...	...	...	...	...
> firm_B			1990	2	1.5	4	...
> firm_B			1991	2	1.6	4.1	...
> ...			...	...	...	...	...
> all_firms		1990	30	50	56	...
> all_firms		1991	32	61	87	...
> ...			...	...	...	...	...
> 
> For each firm, I wish to generate a new variable that uses the values 
> of all_firms. For instance:
> 
> var_10 = var1{firm_A;1990}/var1{all_firms;1990}
> 
> I never managed to find out how I could create such a variable. Can 
> some one help me on this issue?

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