[R] R package: pbatR

Lisa lisajca at gmail.com
Thu Jul 14 17:05:05 CEST 2011


Dear All,

Does anybody have experience with R package pbatR
(http://cran.r-project.org/web/packages/pbatR/index.html)? I am trying to
use it to analyze the family-based case-control data, but the package
totally doesn’t work on my computer. I contacted the authors of the package,
but I haven’t heard anything from them. 

Following the package manual, I tried the simple example as below:

library(pbatR)
library(tcltk)
pbat.set("C:/pbat")

x <- data.frame(pid = c(1,1,1,2,2,2,2,3,3,3),  # three families
                 id = c(1,2,3,1,2,3,4,1,2,3),
             idfath = c(0,0,1,0,0,1,1,0,0,1),
             idmoth = c(0,0,2,0,0,2,2,0,0,2),
                sex = c(1,2,1,1,2,2,2,1,2,1),
    AffectionStatus = c(0,0,1,0,0,1,0,0,0,1),  # 1 for case, 0 for control
               m1.1 = c(1,1,2,2,1,1,2,2,2,1),  # two SNPs with two columns
for each SNP
               m1.2 = c(1,2,1,2,1,2,1,1,2,2),
               m2.1 = c(1,1,2,2,2,1,1,1,2,1),
               m2.2 = c(2,1,2,1,2,2,2,1,1,1))
x1 <- as.ped(x)            

y <- data.frame(pid = c(1,1,1,2,2,2,2,3,3,3),
                 id = c(1,2,3,1,2,3,4,1,2,3),
                age = c(55,50,22,38,37,15,11,42,41,17),
             weight = c(185,170,130,165,170,90,60,170,160,120))
y1 <- as.phe(y)


1. I first consider a model with the disease as a phenotype, and two SNPs as
predictors (on covariates) as bellow:

pbat.m(AffectionStatus ~ NONE, y1, x1, fbat="gee",
distribution='categorical', offset='none')

But some error messages were returned:
Error in writeCommandStrMatch("distribution", distribution, c("default",  : 
  'distribution' can only take on the following values: 'default', 'jiang',
'murphy', 'naive', 'observed'.  You passed the invalid value 'categorical'.

Then I removed last two arguments 
pbat.m(AffectionStatus ~ NONE, y1, x1, fbat="gee")

This time, a box appeared on the console:
R for Windows GUI front-end has encountered a problem and needs to close.

2. I consider a model with the disease as a phenotype, and two covariates
(age, weigth) and two SNPs as predictors as bellow:

pbat.m(AffectionStatus ~ age + weight, y1, x1, fbat="gee")

The function had been running for a very long time and no output was
returned until I had to stop it.

Any help would be greatly appreciated. 

Thanks.

Lisa


--
View this message in context: http://r.789695.n4.nabble.com/R-package-pbatR-tp3667844p3667844.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list