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.