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
Bootstraped mediation with multiple IVsDear Statalisters, I am running a SEM model with multiple independent variables and a cluster varia…
Is a Logarithmic interaction term possible?Hello, I'm currently working on an econometric conflict model, where I've taken the natural logarith…
Creating variables that sum variables in regularly interspaced columnsHi, I would like to create a formula for making variables of the kind: gen newvar = v[k] + v[k+8] +…
psmatch2 and pstestHallo, I have a question regard "psmatch2" and "pstest". I use the same propensity score, but i am …
Comparing mortality rate over yearsDear Statlisters, I am trying to find : whether there is a "significant change in the mortality rate…
Subscribe to:
Post Comments (Atom)
0 Response to Counting Instance of a variable and returning average
Post a Comment