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.
Fixed or random effects with unbalanced panel data?Dear community, I have an unbalanced panel dataset of 165 countries from 1991-2019, in which my dep…
Generating Count of Recurring names in Successive Time PeriodsHi Statalist, I had a small question that I was hoping to get help with. I refer to the table below …
stata doesn't recognises the values of variablesDear all, I just was working on excel files (census data) with the following code: Code: clear* …
Using SMCL in Stata GraphsIs there comprehensive documentation of which SMCL tags do and do not work as intended when producin…
Same datapoint across different date formatsI am looping over different date variables in a graph, that will be my x-axis. The four variables ar…
Subscribe to:
Post Comments (Atom)
0 Response to Creating a list of most common households in a census dataset.
Post a Comment