| Date: | Fri, 30 Jul 2010 13:09:55 -0500 |
| Reply-To: | "Data _null_;" <iebupdte@GMAIL.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | "Data _null_;" <iebupdte@GMAIL.COM> |
| Subject: | Re: Help with Kruskal-Wallis code... |
|
| In-Reply-To: | <201007301709.o6UAktq2013706@malibu.cc.uga.edu> |
| Content-Type: | text/plain; charset=ISO-8859-1 |
|---|
I don't know if this is the right thing to do but if you add a FREQ
statement specifying NUMBER you get results. I don't know if they are
correct. Dale?
proc npar1way data = KW_test wilcoxon;
by category notsorted;
class market;
var percent;
freq number;
run;
On 7/30/10, Andy Satchwell <asatchwell@lbl.gov> wrote:
> Hi SASheads,
>
> I am trying to run a Kruskal-Wallis test to look for statistical differences
> in saturation of energy efficiency measures across different markets. My
> data--in SAS--is structured as:
>
> data KW_test;
> input category $ market $ percent number;
> cards;
> controls federal 0.41 219
> controls mush 0.63 1387
> controls private 0.25 148
> chillers federal 0.28 127
> chillers mush 0.21 460
> chillers private 0.14 83
> cogen federal 0.04 20
> cogen mush 0.03 74
> cogen private 0.03 16
> run;
>
> The percent value represents the saturation of each category (i.e., energy
> efficiency measure) for all projects within a particular market (e.g.,
> federal, etc.). For example, the data shows that controls occur in 41% of
> all federal market projects (219/534). I am interested in seeing whether
> there is a statistical difference for the percent saturation across the
> three markets . For example, I want to know if, for chillers, the percent
> saturations of 28%, 21%, and 14% are statistically different across the
> federal, mush, and private markets, respectively. I used the following
> command (it's a Mann-Whitney, but outputs Kruskal-Wallis, because we need to
> compare more than two categories):
>
> proc npar1way data = KW_test wilcoxon;
> by category;
> class market;
> var percent;
> run;
>
> The code produces no statistical results and instead the log stated, for
> each category, that it was skipping the analysis because of "not enough
> data." I think that the code is failing, because the project-level data is
> already aggregated to percentages.
>
> Am I using the wrong test? If not, what is the correct code to test if
> there are statistically different percentages across markets. Please note
> that I have also included the sample size of the number of projects (i.e.,
> "number" in the above code) that installed that particular category.
>
> Thanks!
>
|