sas >> appropriate contrasts for 1-way anova with unequal sample sizes

by Jackson_AIG » Thu, 09 Dec 2004 00:03:31 GMT

Unequal sample sizes complicate the assignment of coefficients for
contrasts. I was taught, and some textbooks still teach, to weight the
coefficients using the sample sizes. I have not found any mention of this
in the SAS literature I have available to me, and in fact as far as I can
discover, it is impossible to use coefficients that do not sum to zero (in

Has anyone found a way to trick SAS into allowing the correct
coefficients? Or is my statistical lore terribly out-of-date?

Thanks in advance,

Tom Martin
Asst. Prof. of Aquatic Ecology
Biology Dept.
Western Carolina University

Similar Threads

1. Logistic Regression with Unequal Sample Size

Dear Friends,

SAS manual says that we can control for overdispersion for binary data,
specifically by using option of Scale = .  But it also says that
options of "Scale = Deviance" or "Scale=Pearson" assume equal sample
size.  In the case of unequal sample size, option of "Scale = Williams"
but it should be proportion (=event/trials ) type of data format.

Is theie any way to control overdispersion with unequal sample size
under binormial data (=0/1) format?

I always thanks for whom relpied for my answer.


2. Pair mean test for binary variables with unequal sample sizes

3. Question on repeated ANOVA sample size


  I have a repeated study in two groups, and each group has 3 times repeated measurement. the reference data include the mean in intervention group at each time point is 24, 22, 21;
  the mean in control group at each time point (assume) 24 25 25;
  the sd in intervention group is 2.7, in control group is 2.4.

  I need to calculate the sample size for this repeated ANOVA design.  I'm using PASS to calculate it, but not sure how to fill Sm for each data tab and test for report Tab? Could some one help me on it and give me some interpretation about why and how I fill them? or any other suggestions. Thanks much.


Never miss an email again!
Yahoo! Toolbar alerts you the instant new Mail arrives. Check it out.

4. Sample size estimation for ANOVA with repeated measures

5. 2 way ANOVA sample size calc

I have 3 treatment groups and 2 genders
I am planning to have
1/an equal N in each of the 6 subgroups
4/power=80% on the no treatment effect test (at 0.05 level)

What sample size do I need?

I used proc glmpower (and obtained N=4344!). I would like to get a
more reasonable sample size. Can anybody help me debug the following

data mylib.notespb;
input DepVar Treat Gender;
   11      1	1
   10      2	1
   10      3	1
   11      1	2
   10      2	2
   10      3	2

PROC GLMPOWER DATA=mylib.notespb;
CLASS Treat Gender;
MODEL DepVar= Treat Gender;

6. Planned contrast using proc glm, adjusting for unequal variance

7. SurveySelect not selecting where sample size exceeds sampling

Here is the sampling code (slightly anonymised).

Proc SurveySelect Data = YOURLIB.YOURDATA
                   Out = DATA.SAMPLE
                Method = SRS   N = 1000;
  Strata PRODUCT;

Due to the size of the input data table, the procedure was interrupted
through the break command.

Some thirty or so product values had been sampled, although most
produced messages similar to the following.

ERROR: The sample size, 1000, is larger than the number of sampling
units, 181.
NOTE: The above message was for the following stratum:

However, a table was produced and used to verify subsequent steps that
matched analytical values.  The following log entry reflects the

WARNING: The data set DATA.SAMPLE may be incomplete.  When this step was
stopped there were...

When the code was run to completion (albeit on another machine), the
WARNING message also indicated that the output table was not created.
In both cases, the output table did not exist prior to the step being

What did I want??????

1000 records selected randomly from each stratum.

Where the stratum had a population less than 1000, select all the

In the first run, this appeared to happen.

In the second and complete run, the errors prevented any table being

I can't find anything in the FM to indicate there is an option I should
set to select the whole population where the sample cannot be met, but I
may have missed something.

Possible confounding factors include that they are different machines
and SAS installs, and there may be a different option setting affecting
the outcome.  Also that the behaviour of creating the output data set is
only interrupted by the Procedure where the proc runs to completion.

Please don't suggest I hard code a data step solution.  One was proposed
but for the size of the data it resulted in a lot of time doing what a
single procedure was expected to do in a single data pass.

Kind regards


************** IMPORTANT MESSAGE *****************************
This e-mail message is intended only for the addressee(s) and contains information which may be
If you are not the intended recipient please advise the sender by return email, do not use or
disclose the contents, and delete the message and any attachments from your system. Unless
specifically indicated, this email does not constitute formal advice or commitment by the sender
or the Commonwealth Bank of Australia (ABN 48 123 123 124) or its subsidiaries.
We can be contacted through our web site:
If you no longer wish to receive commercial electronic messages from us, please reply to this
e-mail by typing Unsubscribe in the subject line.

8. Help with ANOVA contrasts