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
Difference in Difference in Matching by incorporating geographical fixed effectsDear All, I would like to ask about matching. If I have a panel data and I want to run Difference i…
Option for mass replace instead of manually replacing many string variablesHello Statalisters, I want to merge two datasets using two string identifiers i.e. name of state an…
how to create a factor variable in this case? and what is a threshold?Create factor variable “pop_fact” out of population, consisting of three categories: low populated, …
Propensity score matching commandHello everyone, i want to use propensity score matching for impact evaluation. I used these ado comm…
Conformability error, r(503)Hi. I've been getting the conformability error r(503) on running the code below. Obviously my matrix…
Subscribe to:
Post Comments (Atom)
0 Response to Counting Instance of a variable and returning average
Post a Comment