Weighted graphics are a complicated topic for which statisticians have not reached a consensus. However, if you want to visualize the weighted distribution, you can create a weighted empirical CDF, as shown in the article that I mentioned earlier. For your data, the weighted ECDF would look like this:
data Have;
input x w;
datalines;
1 1
2 2
3 1
4 2
5 2
6 4
7 3
8 1
;
run;
title "Weighted Percentiles";
/* put sum of weights into macro variable */
proc sql noprint;
select sum(w) into :sumWt from Have;
quit;
%put &=sumWt; /* display value in SAS log */
data Want;
set Have;
wt = w / &sumWt; /* standardize Sum(wt)=1 */
run;
proc means data=Want p25 median p75;
var x;
weight wt;
run;
/* use IML to form weighted ECDF from data */
proc iml;
use Want; read all var {x wt}; close;
cumWt = cusum(wt);
cutPts = 0 // cumWt;
/* generate data for WECDF */
t = do(0, 0.999, 0.001);
idx = bin(t, cutPts);
q = x[idx];
create WECDF var {t q x}; append; close;
QUIT;
title "Weighted ECDF";
proc sgplot data=wecdf noautolegend;
xaxis grid label="x";
yaxis grid offsetmin=0.1 label="Cumulative Proportion";
step x=q y=t;
fringe x / lineattrs=(color=black);
refline 0 / axis=y;
run;
... View more