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
Job Posting for Biostatistician at Cancer Support CommunityEXECUTIVE SUMMARY The Cancer Support Community’s Research & Training Institute (RTI) in Philadel…
Aggregation of pre-post treatment data (5 year intervals)I am trying to efficiently aggregate the IDA dollar (all_ida) amounts for the 5 year period before t…
PSM/Probit: 7 successes completely determined.Hi, I am doing propensity score matching and use the command psmatch2 in Stata 15.1. Below the tabl…
marking ticks in the bar graphHi, Below is my graph that I used to generate the following graph. I want to add ticks to the middl…
forvalues and xtile.Hello! I have a dataset with income and expense throughout several years (1992, 1994, ... 2016) I wa…
Subscribe to:
Post Comments (Atom)
0 Response to Counting Instance of a variable and returning average
Post a Comment