Colour coding:
# comments
> user commands
1) EITHER: Download the tar file all.tar.
At the UNIX prompt, type:
tar -xvf all.tar
(this creates the directory "gamcode" containing all the code and data)
OR: download each function one by one into the working directory.
2) Change directory to directory gamcode, or choose some other working
directory to download the functions into.
Create .Data directory in the working directory
(mkdir .Data).
Start Splus.
Type
>source("startup.func")
> startup.func()
This reads all relevant functions into Splus.
Read in the example data set with:
> cb <- read.table("cb", header=T)
All objects can now be removed from the working directory if required, with the exception of the BATCH file bootstrap.in.
3) Demonstration analysis on the data set cb.
Enter the following commands:
> indcb <- indsp.func(cb, c(4, 7, 10, 15, 20, 33)) # (calculates index curve for a variety of df)
> cb.bootind.119.10 <- outer.boot.func(cb, 10, 119, "cb.bootind.119.10")
> # (this is the bootstrapping: might take a minute or two for 119 replicates)
> motif() # (opens graphics device: not needed for all versions of Splus)
> sp.plot("cb", 10, cb.bootind.119.10, 1, 6, 1, conf=0.95)
The other functions were all used invisibly in the demonstration.
NOTE:
The demonstration data set provided is very small and only 119 bootstrap replicates were taken for a fast demonstration. For large data sets, the better way to do the same bootstrapping is as follows:
1) Quit Splus.
2) Edit the file bootstrap.in, changing Nreps=399 to Nreps=119 on the third row.
3) Type at UNIX prompt (not in Splus):
Splus BATCH bootstrap.in cb.bootind.119.10
(I don't know how this works on Splus for WINDOWS).
4) Monitor the bootstrap progress by viewing the file cb.bootind.119.10. When it has finished (rep119 appears on last line), restart Splus and the object cb.bootind.119.10 will have appeared. Carry on with sp.plot(...) as above.
For real applications, it is worth using the BATCH approach if the computation is going to be run overnight. If there are only a small number of sites in the data set, and the bootstrapping will not take very long, the function outer.boot.func in Splus is easier to use.