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
Correlation tables and R-squared in panel dataDear all, currently I'm running a panel regression as a part of a seminar. My topic is the statisti…
Numbering Similar ObservationsHello, I'm having significant difficulty numbering observations. I've attached a screenshot for cla…
import tfw or tif data on STATAHello, I am very new at geographic data analysis. I have the project to use tfw or tif datasets (NOA…
MergeHi all, I have the following two datasets. The first one looks like follows: Code: * Example gene…
type mismatch in a regression with &Hello, When I run this regression : xi: areg z_educ i.stateid hhsize highest_maleeduc highest_femed…
Subscribe to:
Post Comments (Atom)
0 Response to Sampling using sample command
Post a Comment