Greetings all,
I'm trying to construct percentiles using the pctile command with Stata.
This is the code that works, with no weights:
pctile pct = (robot_pred), nq(722) genp(percent)
This is the code that does not work. It includes my attempt to introduce population weights:
pctile pct = (robot_pred) [ipums_pop_1990=weight], nq(722) genp(percent)
The error that is returned is:
weights not allowed
r(101);
Does anyone know what may be causing this error? I'm happy to indulge work-arounds, but am positively befuddled as to why pctile is generating everything fine, but not allowing weights to be introduced. My understanding is that pctile allows weights when used in this way.
For context: I'm trying to population-weight what is basically community-level data. The underlying unit of observation is the community (of which there are 722 in this dataset). And the weight would just be each community's population in 1990. All on Stata 17.
Related Posts with weight issue with pctile
Threshold regression model for cross-sectional dataHello everyone! I am planning to run a threshold regression model for a cross-sectional data. Howeve…
lrtestHello, I have three variables and want to see if it is worth including all of them in the model or …
mofd and twoway connected graph issueHello, I use Stata 14.2. I am working on a cross-sectional dataset. I have used the command mofd to…
matching the x/y coordinates of flats/houses to a environmental noise mapMy aim is to match the x/y coordinates of flats to a environmental noise map. The latter is segmente…
Prediction for discrete-time frailty models with normal heterogeneity (xtcloglog)Dear Statalist. I have estimated a discrete-time hazard model with a normal unobserved heterogeneit…
Subscribe to:
Post Comments (Atom)
0 Response to weight issue with pctile
Post a Comment