| Date: | Sat, 14 Mar 2009 19:35:04 -0400 |
| Reply-To: | Arthur Tabachneck <art297@NETSCAPE.NET> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Arthur Tabachneck <art297@NETSCAPE.NET> |
| Subject: | Re: Histogram taking account sampling weights |
|
Is the following similar to what you are asking?:
roc summary data=sashelp.class;
var height;
class sex age;
output out=testdata (where=(_type_ eq 3)) mean=;
run;
proc univariate DATA = testdata;
BY sex;
VAR height;
HISTOGRAM / CFRAME=GRAY CAXES=BLACK WAXIS=1 CBARLINE=BLACK
CFILL=BLUE PFILL=SOLID ;
WEIGHT _freq_;
RUN;
If it is, then I'd suggest simply disaggregating your data like:
data need;
set testdata;
do i=1 to _freq_;
output;
end;
run;
proc univariate DATA = need;
class sex;
VAR height;
HISTOGRAM / CFRAME=GRAY CAXES=BLACK WAXIS=1 CBARLINE=BLACK
CFILL=BLUE PFILL=SOLID;
RUN;
HTH,
Art
--------
On Sat, 14 Mar 2009 19:57:33 -0300, SAS User <sasusr@GMAIL.COM> wrote:
>Hi I'm trying to use a simple univariate procedure to produce histogramS
>taking account sampling counts but I'm having some problems.PROC
UNIVARIATE
>DATA = LIBRARY._2_AB;
>BY BI;
>VAR TOTAL_DEROG;
> HISTOGRAM / CFRAME=GRAY CAXES=BLACK WAXIS=1 CBARLINE=BLACK
>CFILL=BLUE PFILL=SOLID ;
>WEIGHT WEIGHT;
>RUN;
>
>But the in the log I'm having the following msg: ERROR: A WEIGHT variable
>cannot be used together with a HISTOGRAM, QQPLOT, or PROBPLOT statement.
>What can I do to make that histograms taking the sampling weights into
>account?
>
>Thanks,
>Ed.
|