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
common supporthi how can i use the value of pscore to construct the common support. i should use the minimum betwe…
Graphing interactions with margins after melogit with random interceptsI have an interaction term between season and temperature in my final model (both 4-level categorica…
Importing fixed with data using infix - dictionary invalidHello, I am importing fixed with data from a .txt file. Here is my code: Code: cd "...\1973-09-t…
Importing fixed width data using infix - dictionary invalidHello, I am importing fixed with data from a .txt file. Here is my code: Code: cd "...\1973-09-t…
Calculate Exponentially Weighted Moving Average for Unbalanced Panel DataHi all, I want to calculate exponentially weighted moving average of past performance in an unbalan…
Subscribe to:
Post Comments (Atom)
0 Response to Counting Instance of a variable and returning average
Post a Comment