Hello Everyone,
I have a dataset which has data for 100 households from each of 3 cities. Further, 5 members from each household are listed in the dataset. So in total, I have 1500 (3*100*5) observations. The household members are divided into 20 groups based on certain characteristics (each member is assigned a group number between 1 and 20).
Lets call the variables as city, household, member and group.
I want to select (using sample command or any other efficient method) 20 members from each city (one from each group). My condition is that only one member can be selected from each household.
When I run the following command:
bysort city group: sample 1, count
I get one member sampled from each group within each city but this command selects (in some cases) more that one members from one household.
What I want is if one member is selected from some group from household1, then no other member in a particular city should be sampled from household1 and one member from each group should also be selected from each city.
Kindly advise how can I achieve this.
Thank you!
Amit
Related Posts with Sampling using sample command
[HELP] Appending several CSV files togetherHello Statalist, Currently trying to append several CSV files into one on Stata (I understand the r…
Graph two slopes from grouped xtregressionHello, I would like to graph the two coefficient slopes I obtained from my xtreg command. This is m…
Exporting tabstat to wordHello, I use Stata 14 and am trying to export a tabstat table into word. I have read through some t…
tabstast: How to display the highest values in a single table?Dear Statalist, I would like to make a table that shows the frequency of the 2 highest sales in the…
create unique county ID for each stateI have a panel data. I want to assign a unique ID to each county within each state. For example, for…
Subscribe to:
Post Comments (Atom)
0 Response to Sampling using sample command
Post a Comment