Below, I have some survey data where we (wanted) respondents to answer for 30 straight days. Of course, many respondents missed a handful of days here and there.
Right now, we just have a counter for each survey someone took. But, what I want to do is identify a respondent's non-response date(s), add that row back into the dataset, and include some flag for "nonresponse" or something like that as well, so I can identify these rows later. How can I do this?
* Example generated by -dataex-. For more info, type help dataex
clear
input str3 pptid float(survey_date surveynum)
"100" 21769 1
"100" 21770 2
"100" 21771 3
"100" 21772 4
"100" 21773 5
"100" 21774 6
"100" 21775 7
"100" 21776 8
"100" 21777 9
"100" 21778 10
"100" 21779 11
"100" 21781 12
"100" 21782 13
"100" 21783 14
"100" 21784 15
"100" 21785 16
"100" 21786 17
"100" 21787 18
"100" 21788 19
"100" 21789 20
"100" 21790 21
"100" 21791 22
"100" 21793 23
"100" 21794 24
"100" 21795 25
"100" 21796 26
"100" 21797 27
"100" 21798 28
"200" 21806 1
"200" 21807 2
"200" 21808 3
"200" 21809 4
"200" 21810 5
"200" 21811 6
"200" 21812 7
"200" 21813 8
"200" 21814 9
"200" 21815 10
"200" 21816 11
"200" 21817 12
"200" 21818 13
"200" 21819 14
"200" 21820 15
"200" 21821 16
"200" 21822 17
"200" 21824 18
"200" 21825 19
"200" 21827 20
"200" 21828 21
"200" 21829 22
"200" 21830 23
"200" 21831 24
"200" 21832 25
"200" 21833 26
"200" 21834 27
"200" 21835 28
"300" 21869 1
"300" 21870 2
"300" 21871 3
"300" 21872 4
"300" 21873 5
"300" 21874 6
"300" 21875 7
"300" 21876 8
"300" 21877 9
"300" 21878 10
"300" 21879 11
"300" 21880 12
"300" 21881 13
"300" 21882 14
"300" 21883 15
"300" 21884 16
"300" 21885 17
"300" 21886 18
"300" 21887 19
"300" 21888 20
"300" 21889 21
"300" 21890 22
"300" 21891 23
"300" 21892 24
"300" 21893 25
"300" 21895 26
"300" 21896 27
"300" 21897 28
"300" 21898 29
end
format %td survey_date
Right now, we just have a counter for each survey someone took. But, what I want to do is identify a respondent's non-response date(s), add that row back into the dataset, and include some flag for "nonresponse" or something like that as well, so I can identify these rows later. How can I do this?
* Example generated by -dataex-. For more info, type help dataex
clear
input str3 pptid float(survey_date surveynum)
"100" 21769 1
"100" 21770 2
"100" 21771 3
"100" 21772 4
"100" 21773 5
"100" 21774 6
"100" 21775 7
"100" 21776 8
"100" 21777 9
"100" 21778 10
"100" 21779 11
"100" 21781 12
"100" 21782 13
"100" 21783 14
"100" 21784 15
"100" 21785 16
"100" 21786 17
"100" 21787 18
"100" 21788 19
"100" 21789 20
"100" 21790 21
"100" 21791 22
"100" 21793 23
"100" 21794 24
"100" 21795 25
"100" 21796 26
"100" 21797 27
"100" 21798 28
"200" 21806 1
"200" 21807 2
"200" 21808 3
"200" 21809 4
"200" 21810 5
"200" 21811 6
"200" 21812 7
"200" 21813 8
"200" 21814 9
"200" 21815 10
"200" 21816 11
"200" 21817 12
"200" 21818 13
"200" 21819 14
"200" 21820 15
"200" 21821 16
"200" 21822 17
"200" 21824 18
"200" 21825 19
"200" 21827 20
"200" 21828 21
"200" 21829 22
"200" 21830 23
"200" 21831 24
"200" 21832 25
"200" 21833 26
"200" 21834 27
"200" 21835 28
"300" 21869 1
"300" 21870 2
"300" 21871 3
"300" 21872 4
"300" 21873 5
"300" 21874 6
"300" 21875 7
"300" 21876 8
"300" 21877 9
"300" 21878 10
"300" 21879 11
"300" 21880 12
"300" 21881 13
"300" 21882 14
"300" 21883 15
"300" 21884 16
"300" 21885 17
"300" 21886 18
"300" 21887 19
"300" 21888 20
"300" 21889 21
"300" 21890 22
"300" 21891 23
"300" 21892 24
"300" 21893 25
"300" 21895 26
"300" 21896 27
"300" 21897 28
"300" 21898 29
end
format %td survey_date

Comment