Hello everyone, hope you all have a good day ahead.
So i want to ask 1 question.. i have a data set which consist of ID, Year, Dummy_rich....
Announcement
Collapse
No announcement yet.
34 results in 0.0117 seconds.
egen
x
You can also choose from the popular tags.

generate new variable using egen with sum/count
 2 posts

 3 posts

Computing average productivity per weekday and weekend
Hi everyone,
I have a dataset which more or less looks like the one provided below. For this dataset, I want to calculate the average number...
 6 posts

Keep rows if two consecutive columns have the same value
I am trying to filter rows based on a condition where two consequtive columns have a particular value. Say I have the following data consisting of an...
 12 posts

egen's anycount() incorrectly counting
I have a list of 23 variables that can have a value between 1 and 12. I would like to get the number of variables in a given row that have a certain value....
 8 posts

Jeffery Sauer started a topic Subsetting variable lists with other variable lists, and then using the result in gen/egen?in GeneralSubsetting variable lists with other variable lists, and then using the result in gen/egen?
Dear STATA Forum,
Perhaps this is a relatively simple request and I am just not thinking about it in the correct way (most of my background...
 6 posts

Beginner: Frequency of variable in dataset
I tried a few egen commands to do what I need, but can't figure it out.
I want to create a new variable that returns a total by each unique...
 3 posts

Work by family instead of individual
Hello, I am working with a public survey database that gathers data at the household, family and individual level. Meaning, in each household there is...Last edited by Fernanda Pavez; 07 Sep 2018, 13:17.
 3 posts

rowmax returning observation number, not max within row
Dear all,
For some reason, when I run this code on my dataset, egen creates a variable containing the observation number of each row instead...
 4 posts

Creating a sum of variables when there are no missing values (.)
Hello all, I'm a relatively new Stata user.
I have a set of variables that are the responses to a survey, and I need to create a variable...
 7 posts

select middle number with egn
Hello everyone. I have 5 variables as below:
Id d1 d2 d3 d4
1 2 2 3 4
i used egen=rowmin(d1d4) rowmax(d1d4)...
 7 posts

Procedure to group variable with minimum number of observations
Dear Statalists,
I have a discrete variable, that takes integer values larger or equal to zero. I want to cut the values into categories...
 3 posts

Emiliano Carlevaro started a topic Egen Mean Function Is Not Generating a Double Var? (Precision Problem or Egen Mean?)in GeneralEgen Mean Function Is Not Generating a Double Var? (Precision Problem or Egen Mean?)
When I use mean() function from egen it seems that egen does not store the result as double even when I indicated that. The result is problematic since...Last edited by Emiliano Carlevaro; 06 Dec 2017, 17:05.
 6 posts

Chris Labos started a topic Generate vs. egen for creating new variable when missing values are presentin GeneralGenerate vs. egen for creating new variable when missing values are present
Dear All,
I'm trying to create a new variable in my dataset that is derived from multiple other variables.
chadsvasc can be...
 5 posts

Counting distinct observation in time range by inrange
Dear statalists,
I would like to count distinct observations based on certain criteria for previous three years, and save it as a dataset,...
 13 posts