Programs: BYCOMP.SAS & MACOMP.SAS
Authors: Peter Ott & Fred Hovey
Created: June 3, 1997
Versions: 1.0
Here are two SAS programs that perform Compositional Analysis
as
described in the work by Aebischer et. al. (Ecology. 1993.
74(5): 1313-1325).
It is important that the user fully understand the above
paper, and has some
knowledge of SAS before proceeding. We realize that both
programs are not
optimal in terms of efficiency, but they do run well even
on
older versions of SAS, as long as the SAS/STAT module is
installed.
The programs are also straightforward to modify/customize
(e.g. incorporating design effects, changing the style of
input, etc.).
They've been tested on several different platforms including
Windows NT 3.51, Windows 3.11 and
UNIX, in both batch and interactive modes. Additional error
monitoring has
*NOT* been incorporated into the code.
The two programs do differ markedly in speed and memory
requirements.
BYCOMP.SAS uses a SAS 'by' statement to cycle through the
randomization procedure.
This allows the program to run fast but also demands a lot
of memory (16 MBYTES
is a *minimum* amount to run 999 simulations). A very large
file (rwilks.txt) can
be generated and so disk space may also be a concern. Therefore,
it is best
suited for users with (access to) beefy machines.
MACOMP.SAS uses a macro loop to cycle through the randomization
scheme. Although
this makes the program very slow, it takes up only a small
amount of memory.
It is best suited for users with less powerful (or unstable)
machines. Once
familiarized with this program, we recommend running BYCOMP.SAS
to increase
its speed. For example, when 999 randomizations were performed
on an old SUN Sparc
workstation, MACOMP.SAS took 40 minutes (using the XWindows
GUI) to complete,
while BYCOMP.SAS finished in only 5 minutes!
The two programs are similar in most other respects.
Please be aware that two files are generated. The file
'rwilks.txt' is the output
(Wilk's lambda) of the randomization(s). The file 'owilks.txt'
is the output
(Wilk's lambda) based on the observed data. These two files
are parsed and the
statistics are compared to calculate a pvalue. As it stands,
the two files are
placed in the SAS working directory. You may change the
location for these
files by appending a path to the filename statements (the
stuff in quotes)
near the beginning of the code. Do *NOT* change the file
references "rwilks"
and "owilks".
The user must supply the data as an external text (space
delimited) file in the
following form: A one line header labeling the columns must
be present, which
consist of observed data (proportions) ordered as "used
habitat 1", "used habitat
2", ... , "used habitat D", "available
habitat 1", "available habitat 2", ... ,
"available habitat D". Habitat types that are
available but not utilized by an
animal should have been replaced by a small number (e.g.
0.01%). True 'missing
values' (i.e. when the habitat type is neither available
nor used) are not (*yet*)
permissible - this situation can be remedied by removing
animals with missing
values or collapsing the number of habitat types. Please
see the provided file
"radvsmcp.txt" for an example; this file depicts
pheasant radio locations vs. MCP
home range information and is taken directly from Aebischer
et. al. (1993).
The ordering of the data-columns is retained throughout
the program, including
the display of the final output - keep this in mind when
interpreting the results.
Note that it is common for the available proportions to
be equal for every animal;
modifying the code to efficiently read such data involves
changing the input
statement in the "raw" data step accordingly AND
removing the "/2" from the first
"numb" data step.
The path in the third filename statement (near the beginning
of the code) will
likely need to be modified to include a different location.
Do *NOT* change the
file reference "use_avl".
The only other item that the user may need to change is
the number of simulations
(which is one of the first lines in the code). Currently,
it is set to 999.
We hope these programs are useful to you. Please give credit
to their authors if
you do use them. We take *NO* responsibility for their misuse
or any damage they
may cause (e.g. melted hard disks, fried cerebral cortices)
in their current or
alternative form.
Cheers,
Peter Ott
peter.ott@gems7.gov.bc.ca
Biometrician
Research Branch
B.C. Forest Service
Victoria, B.C.
Fred Hovey
fhovey@galaxy.gov.bc.ca
Wildlife Habitat Analyst
Research Branch
B.C. Forest Service
Revelstoke, B.C.
P.S. For those who are interested in conducting a retrospective
power analysis
after the smoke clears, Michael Friendly has an excellent
program (that does
require the SAS/IML module) called MPOWER.SAS; it can be
found at the URL:
< http://hotspur.psych.yorku.ca/SCS/sasmac/mpower.html
>.
A recommended reference on this topic is: Stevens, J. P.
1980. Power of the
multivariate analysis of variance tests. Psychological Bulletin.
88(3): 728-737.
|