Skip to content
Prev 5554 / 20628 Next

pcmid of OSWALD in R

On Sun, 13 Mar 2011, rajibul islam wrote:

            
Hi.

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.