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
Speed Up StataHello How we can speed up the Stata calculations please …
Reading fixed-format text files into STATAHi everyone, I want to read multiple fixed format-text files for multiple years into Stata. I have …
Generating missing observations with the next available observationHello, here is a small part of my dataset. The full dataset is about 50million observations: You ca…
Loop for xtline with graph combine Stata codeDear all, I want to plot calories for the each panel id over the year. Here I have written the loop …
Putdocx decimal issueHello all: I wanted to get the median, and IQR numbers to show only 1 decimal but I am seeing 10. Al…
Subscribe to:
Post Comments (Atom)
0 Response to weight issue with pctile
Post a Comment