I am working on a time series analysis looking at differences in the proportion of crimes reported to police before and after an event. I am looking at incidents within individuals, and svysetting the data because the dataset requires a subgroup for the analysis. However, the weight at the individual level is not the same across reporting periods and so the model won't run.
I need to run the model unweighted among just the subsample above, but can't drop other observations because I need to keep PSUs for all observations in the data. From NCVS user's guide: "Each combination of the year group, pseudo-stratum, and half-sample codes present on the household file must also be present on the incident file. If no respondents from a particular PSU were victimized, then the entire PSU would be missing from the incident file. This requires creation of dummy records, where PSUs without reported victimizations are included on the incident file with nonzero weights and values for design variables but missing values for all incident characteristics (see example record in Table 2-1). In addition to adding dummy records, the analyst should add an indicator variable to the file that equals 1 if the record is a dummy record and 0 otherwise. This allows dummy records to be excluded from all calculations".
As such, my question is how to code the multilevel regression and account for the subpopulation. I tried an "if" statement but received an error that if could not be used.
Thank you in advance!
Code:
svyset IDPER, weight(WGTPERCY) || _n, weight(SERIES_WEIGHT) gen sub=[(exclude_outUS==0) & (dummy==0) & (V3018 ==2) & (IPV==1) & (inrange(YEAR,2008,2019)) & (inrange(LATINAW,0,1))] svy, subpop(sub): mepoisson prop_report EVENT##LATINAW i.YEAR V3040 i.EDU i.MARITAL || IDPER:
As such, my question is how to code the multilevel regression and account for the subpopulation. I tried an "if" statement but received an error that if could not be used.
Thank you in advance!