R programs and datasets to complement some
of the examples in 'In All Likelihood: Statistical
Modelling and Inference Using Likelihood' , Y. Pawitan, Oxford
University Press, 2001.
The package should include all the datasets and programs required to
do all the examples and figures or anything
that requires numerical computations.
Pls let me know if there is anything missing.
Jan 2004: lkpack.zip has been revised:
(i) Some programs have been corrected in line with the
latest error list; (ii) Datasets from some exercises have been added;
(ii) The assignment symbol "_" has been changed to "<-"
to conform with the R1.8.
All programs have been tested in R for Windows.
Beware of uppercase-lowercase
sensitivity when transporting them to Unix-based systems. Also,
since R and Splus
are not exactly the same, some work is needed to make the programs run
for Splus. For example, the mathematical labeling of plots and the nonlinear
optimization function nlm()
would have to be replaced.
Disclaimer
The programs are provided in good faith and in the hope
that they will be useful, but the author cannot warrant their accuracy
nor can he be held responsible for the consequences of their use. The original
sources of the datasets are given in the book.
Getting there ...
-
If you have not done so, download
and install R. (The whole process should take less than 10 minutes.) Note
that some examples require some R package. For example, Example 10.6 requires
R package 'survival'.
The R packages are available in directory
/R/bin/windows/contrib
in the R website.
-
Windows users: download lkpack.zip
(if the mouse left click does not work, click on the right button and choose
'Save Link As'); then unzip it inside a natural subdirectory.
- You will notice that the files are named according to the example number,
figure number or section number; for example, ex4-2.r is the R program
for Example 4.2, while fig2-1.r will produce Figure 2.1. Note that sometimes
the examples are split; for example ex4-7.r and ex4-7c.r, or ex6-18a.r
and ex6-18b.r.
-
Before running R, set the working directory to the subdirectory where you
unzip lkpack.zip. (Under Windows, the working directory is set at the 'Properties'
menu that you can get by clicking the right mouse button on the R icon.)
-
Start R. An example is run by sourcing the file. For example
> source('ex2-1.r')
will run the program for Example 2.1. Alternatively, to understand what
the program is doing, you can run the program piece-by-piece by copying-and-pasting
between an editor and the R command window.
Errors...
Pls let me know
(yudi.pawitan@ki.se)
if you find errors in the text or the programs.