Hello,
I am working with survey data with household ID variables, and I want to assign each hh to receive one of 5 possible scenarios for a question in a future survey. I want to ask each hh the question twice, and ensure that the hh is not assigned to the same condition two times. the variable
*number of households
sum sample
local n = `r(sum)'
*number to assign to each condition
local n_assign_1 = floor(`n' / 5)
local n_assign_2 = ceil(`n' / 5)
local n_assign_3 = round(`n' / 5)
local n_assign_4 = round(`n'/5)
* allocate sample to strata
allocate village if hh_sample == 1, sample(`n_assign_1' `n_assign_2' `n_assign_3' `n'_assign_4) stub(svyexperiment_) min(1) all
* assign households
assign svyexperiment_* if hh_sample == 1, gen(assignment) strata(village)
How would I generate a variable assignment2 that restricts sampling to the remaining four conditions?
I am working with survey data with household ID variables, and I want to assign each hh to receive one of 5 possible scenarios for a question in a future survey. I want to ask each hh the question twice, and ensure that the hh is not assigned to the same condition two times. the variable
*number of households
sum sample
local n = `r(sum)'
*number to assign to each condition
local n_assign_1 = floor(`n' / 5)
local n_assign_2 = ceil(`n' / 5)
local n_assign_3 = round(`n' / 5)
local n_assign_4 = round(`n'/5)
* allocate sample to strata
allocate village if hh_sample == 1, sample(`n_assign_1' `n_assign_2' `n_assign_3' `n'_assign_4) stub(svyexperiment_) min(1) all
* assign households
assign svyexperiment_* if hh_sample == 1, gen(assignment) strata(village)
How would I generate a variable assignment2 that restricts sampling to the remaining four conditions?
