This is my first time posting so I am sorry for any formatting errors. I am using the National Victimization Crime Survey to look at changes in crime reporting over time (a difference in difference analysis). The NCVS recommends using subgroups when conducting analyses and so the data needs to be svyset (that is, I can't include the weighting in the model code itself) and I am having trouble svysetting the data for a multilevel analysis.
The data is incidents nested in people nested in households, which are the primary sample unit and my analysis has incidents nested within women.
NCVS actually provides 3 separate data files at each level and I am using the incident level file, because my outcome is at the incident level (proportion of incidents reported to police).
For reference, the svyset used for non-multilevel analyses with this particular (incident-level) dataset is: svyset V2118 [pweight=SERIES_WEIGHT], strata(strat) vce(linearized)
The model I am trying to run: svy, subpop(sub): mepoisson prop_report TRUMP##LATINAW i.YEAR V3040 i.EDU i.MARITAL || IDPER:
I have come across two errors when trying different ways of setting the data:
1. svyset IDHH, weight(WGTHHCY) || _n, weight(WGTPERCY)
This code produced this error: all observations in subpop() subpopulation have zero weights.
After going back through all of my data management, I realized that the way NCVS has one set up the data to calculate incident totals and proportions sets the household (WGTHHCY) and person (WGTPERCY) weights to zero, so I think this is why I am getting this error. I don't think I am able to set up the data any other way based on the NCVS documentation and so it seems like this way of svysetting the data may not be feasible.
2. I then came across another post on this forum where the poster was doing something similar so I played around with their code and came up with this:
svyset V2117 V2118, strata(strat) weight(SERIES_WEIGHT) vce(linearized)
The code produced this error: too many variables specified
I think the issue here is that NCVS has two PSU variables and so I am not sure how to incorporate both into the svyset code. I tried using just one or other but I received this error: hierarchical groups are not nested within V2117 an error occurred when svy executed mepoisson.
Since the issue is with the weights, I am not sure sharing a data sample would be helpful but I can try to use dataex, if needed.
Any help would be greatly appreciated!
The data is incidents nested in people nested in households, which are the primary sample unit and my analysis has incidents nested within women.
NCVS actually provides 3 separate data files at each level and I am using the incident level file, because my outcome is at the incident level (proportion of incidents reported to police).
For reference, the svyset used for non-multilevel analyses with this particular (incident-level) dataset is: svyset V2118 [pweight=SERIES_WEIGHT], strata(strat) vce(linearized)
The model I am trying to run: svy, subpop(sub): mepoisson prop_report TRUMP##LATINAW i.YEAR V3040 i.EDU i.MARITAL || IDPER:
I have come across two errors when trying different ways of setting the data:
1. svyset IDHH, weight(WGTHHCY) || _n, weight(WGTPERCY)
This code produced this error: all observations in subpop() subpopulation have zero weights.
After going back through all of my data management, I realized that the way NCVS has one set up the data to calculate incident totals and proportions sets the household (WGTHHCY) and person (WGTPERCY) weights to zero, so I think this is why I am getting this error. I don't think I am able to set up the data any other way based on the NCVS documentation and so it seems like this way of svysetting the data may not be feasible.
2. I then came across another post on this forum where the poster was doing something similar so I played around with their code and came up with this:
svyset V2117 V2118, strata(strat) weight(SERIES_WEIGHT) vce(linearized)
The code produced this error: too many variables specified
I think the issue here is that NCVS has two PSU variables and so I am not sure how to incorporate both into the svyset code. I tried using just one or other but I received this error: hierarchical groups are not nested within V2117 an error occurred when svy executed mepoisson.
Since the issue is with the weights, I am not sure sharing a data sample would be helpful but I can try to use dataex, if needed.
Any help would be greatly appreciated!
Comment