I have a survey data about the respondents' beverage intake information across multiple waves, and I need to make the following statement, "X out of XX people responded to at least Y out of YY waves," until YY hits maximum. That is, I need to make a series of statements as following:
- 99 out of 100 people responded to at least 1 of 10 survey waves.
- 79 out of 100 people responded to at least 2 out of 10 survey waves.
- 71 out of 100 people responded to at least 3 out of 10 survey waves.
- ... and so forth until "10 out of 10 survey waves".
At the bottom is a brief sample data I prepared. I created some missing values in the three of the variables I'm using for the sake of this question (to simulate no response). I renamed rep78, trunk, headroom, and gear_ratio as drinkA1, drink A2, and drinkB1, and drinkB2, respectively.
Here's the information for these variables:
drinkA1: drink type A from wave 1 (categorical, e.g. "How often did you drink A this past week? Choose from the following options: 'Never',...'Everyday'")
drinkA2: drink type A from wave 2 (categorical as above--please disregard the non-sensical numbers for this variable)
drink B1: drink type B from wave 1 (continuous, e.g. "How many bottles of drink B did you drink past week? Write this number down and we will convert it into a daily intake")
drinkB2: drink type B from wave 2 (continuous as above)
id: respondent ID
Of note, if the person made a response as to drinkA1 but not drinkB1, it'd count as having responded to wave 1.
How might I approach this? I hope I'm making sense, at least. Please let me know if you need further clarification. Thank you!
Kevin
p.s. I'm using Stata 16.1.
----------
sysuse auto, clear
gen id=_n
gen p=invlogit(.1*mpg + rep78 -8)
sum p
replace headroom=. if uniform() <p
replace trunk=. if uniform() <p
rename (trunk headroom gear_ratio rep78) (drinkA2 drinkB1 drinkB2 drinkA1)
keep drinkA1 drinkA2 drinkB1 drinkB2 id
0 Response to Finding the response rate to questionnaire
Post a Comment