I am a student and new to Stata. Any help is appreciated.
I have a data set with age and weight. I would like to return a table that tells me the number of instances for each age and the average of the weight. Can someone point me in the right direction?
I have tried egen avgwt = mean(avgwt), by(age) and then summarizing the info but it just shows me number of observations and mean, std dev, etc for all observations. I need the average weight by each age and number of instances to use for some other calcs.
Thank you!
Related Posts with Counting Instance of a variable and returning average
Fixed effects panel data regressionHi all, I am trying to run a panel data regression, between firm performance and some firm-specific…
DID with fixed effects – problem with noestimcheck?Dear Statalisters, I am estimating a difference-in-difference with fixed effects. I use the nostimc…
How can we save reordered variables as it always returns to previous order even when I save it?How can we save reordered variables as it always returns to previous order even when I save it? …
Data Setting: dropping empty variables in a quickly wayGood morning to everyone, i was wondering if there is a command that tells Stata to drop variables i…
How to make more than seven categories of a categorical variable transformed from a continuous variable through menu and dialogue box?Can we develop more than seven categories of a categorical variable transformed from a continuous va…
Subscribe to:
Post Comments (Atom)
0 Response to Counting Instance of a variable and returning average
Post a Comment