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
Related Posts with Question on using collapse
Combining datasetsStata friends, I've struggled with this one for a while and hope someone can help me. I have two da…
asdoc eform no longer workingHello everybody, I run a Poisson regression for panel data using xtpoisson with the irr option. I w…
Condition logit model for discrete choice modelhi, i have difficulty dealing with the conditional model for discrete choice model。 i have two scen…
Hurdle Model: For the selection model can I use Heteroscedastic Probit model instead of a logit/probit model?I am working to estimate a demand model for solar installations. Dependent variable is a count varia…
Testing if the mean of a variable has changed significantly over timei am doing an assignment on bank mergers and want to see if there is a significant difference in the…
Subscribe to:
Post Comments (Atom)
0 Response to Question on using collapse
Post a Comment