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
color macros for graphsI'm trying to setup macros to use across a set of graphs for cmyk colors. I've tried local mygray :…
Looping of a specific type of a variable listHey Stata users! I am trying to loop over a list of integer variables to replace missing values. I …
Help Translating Factor Analysis Script from SPSS to Stata SyntaxHi all, I have been tasked with applying a factor analysis to a large data set in Stata. The purpos…
Removing a single character from a stringHello, I am interested in removing the third character from a variable that looks like this: id 011…
I CANT Dowland this code 'xtpanicca'ı tried to dowland Bai and NG Panic Unit root test for panel data, ı use this code to dowland ssc in…
Subscribe to:
Post Comments (Atom)
0 Response to Counting Instance of a variable and returning average
Post a Comment