Statalist The Stata Listserver

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

st: Mean workplace years of education

From   peter harper <>
Subject   st: Mean workplace years of education
Date   Wed, 21 Jun 2006 18:28:35 +0200 (CEST)

Dear Statalist
I am working on a cross-section dataset, with different firms and different individuals. How would one generate a variable which would provide mean workplace years of education:
which is based on percentage of the workforce in each of the k occupations times average years of education for that occupation from worker respondents.
(%OCCjk)*(Greek letter sigma eijk/nk)   k = 1, ..., 9
where eij is workers years of education, i is the individual and j is the workplace and k is the occupation.
I generated this variable, call it Ej by egen before. But now I want to run a workplace-level regression on the RHS. So I need to retreive the mean workplace education from the employee dataset which was merged with the employer dataset. Since I am only using the employer-level data now. 
Can anyone tell me how I could create this variable mean workplace education, Ej, using "collapse". That way I can retrieve that variable and merge it with the employer data.
Many Thanks in advance
*   For searches and help try:

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