I have a dataset which shows the population of Copenhagen in the late 1800s.
And I am interested in getting an overview of which kinds of familymembers the housholds concists of and of how many there are of each combination.
There are a lot of variables, (age, name, etc)
But the two variables which I am interested in are Household number and position in the household.
The household number is a number given to each observation that is in one household. So a family living together each have the same household number.
The position in the household variable has 69 different values. But I have created two sets of dummy variables for each value, one that shows if the observation has the given value (for example servant: 0 or 1) and one that shows if the entire household has one or more of the given value (servant_in_household 0 or 1)
that therefore shows a 0 for each dummy, except for the one dummy that shows the observations position in the household.
my dataset looks like this (not shown, all the 69 dummy variables with 0's and 1's, and other less important variables) :
Array
(postid: individual in the census. Husstnr: household number. civilstand: marital status. Stilling i hustand: position in household)
Now, heres my question:
Can I get Stata to show me a list of the number of households, grouped together by the combinations of positions in the households it has, and then listed from most households of this kind to least.
I'm assuming I first have to sort by household, but besides that, I am at a loss.
This is my dream, getting a list that looks like this:
5689 households containing: mom, dad, child, child
4054 households containing: mom, dad, child child, servant
3009 households containing: mom, dad, child, servant servant
2098 households containing: mom, dad, aunt, child, child, servant
1008 households containing: dad, child, aunt, servant
698 households containing: sister, sister, servant
etc. ..
So it can tell me which household combination of people is the most normal.
My stata is a IC/15.1.
I hope someone can help me.
Related Posts with Creating a list of most common households in a census dataset.
Convert variable to percentileHow can I convert values of a variable to percentiles 0-100? I have tried pctile but it does not gi…
Calculating change using last nonmissing valueHello I am trying to calculate the change in dividend for many firms over time, based on daily stock…
Counting distinct values across loopsI have a simple question that I am sure has been answered, so I apologize in advance. My search thro…
Graph Restrict AxesHi all, Recently switched to STATA from RStudio and encountering a rather mundane issue with graphi…
one of row is non missing then replace first row of each IDDear Listers, Each ID has long rows for the ID and an indicator - complete_surgical. I want to chan…
Subscribe to:
Post Comments (Atom)
0 Response to Creating a list of most common households in a census dataset.
Post a Comment