Hi everyone,

I'm having some doubts on the usage of the -collapse- command and I'm hoping you could help me on this.

I need to calculate the weighted average of a set of observations by year and municipality, weighted on a given variable (let's call it wgt). Will the following syntax work:

collapse (mean) var1 var2 [w=wgt] , by(year municipality)

my question is whether the [w=wgt] will apply to both the means of var1 and var2?

Thanks!

Helen