[R-sig-ME] pcmid of OSWALD in R

David Duffy davidD at qimr.edu.au
Sun Mar 13 23:27:21 CET 2011

On Sun, 13 Mar 2011, rajibul islam wrote:

> I am just wondering about any functions available in R that can work like pcmid
> of OSWALD in S-plus. I tried to find but I didn't find any package like that. I
> need to work with MNAR (Missing not at random) pattern of missing data. Any
> related idea would be highly appreciable. Thank you.


pcmid seems to use the Diggle and Kenward (1994) model, and I don't think 
this exact model is any R packages.  There are a number of alternative 
approaches implemented in R, check the Social Sciences Taskview, and there 
are also the drm and experiment packages, which apparently deal with 
informative missingness for longitudinal experiments.

Finally, if no alternatives are available, you can get pcmid() running in 
R, if not the whole Oswald package.  This may require a bit of fiddling, 
and expertise in R.

a) compile Oswald/Routines/dropout/inform.f using R CMD COMPILE inform.f.
This is the only external code that mlid needs.  This bit works ;)

If you then read the document Oswald/Routines/dropout/dropout.ps and 
Oswald/Doc/Oswald.ps, you can probably write your own pcmid routine for 
your particular problem.  Otherwise...

b) in the Oswald directory, copy oswald.q to oswald.R.  You then need to 
fix things that work in S, but not in R.  The authors have their own type 
of data frame for longitudinal data: ldframe. The first hurdle (I haven't 
gone any further) is that the R rle() only accepts atomic vectors, but 
as.ldframe() gives rle() a factor.  So we would change
rl <- rle(obj$Subject) to
rl <- rle(as.integer(obj$Subject)) and so on, 
load("oswald.R") ; run one of the examples; debug() to find 
incompatibilities. I suspect this won't take too long.

Cheers, David Duffy.

| David Duffy (MBBS PhD)                                         ,-_|\
| email: davidD at qimr.edu.au  ph: INT+61+7+3362-0217 fax: -0101  /     *
| Epidemiology Unit, Queensland Institute of Medical Research   \_,-._/
| 300 Herston Rd, Brisbane, Queensland 4029, Australia  GPG 4D0B994A v

More information about the R-sig-mixed-models mailing list