[R] AD-model builder under R for mix logistics model, a problem.

2008-03-29 Thread coldeyes.Rhelp
the code is list below , i can run this code for laplace approximation 
but not importance sampling.  the code work properly if use impSamp=0 , 
but error for any other number >0 .
could you guys help me out.

thanks so much !

source("http://www.mi.uib.no/~skaug/cash/lesaffre_dat.s";)
 library(glmmADMB)

 fit_glmmADMB_ip <- glmm.admb(y~treat,random=~1,group="subject",impSamp 
=100,data=lesaffre,family="binomial",link="logit",save.dir= NULL)

Initial statistics: 2 variables; iteration 0; function evaluation 0
Function value  1.5926934e+003; maximum gradient component mag  1.2500e+001
Var   ValueGradient   |Var   ValueGradient   |Var   Value
Gradient   
  1  0.  1.2500e+001 |  2  0.  6.2441e-001 |

 - final statistics:
2 variables; iteration 9; function evaluation 13
Function value  1.2593e+003; maximum gradient component mag -5.7984e-005
Exit code = 1;  converg criter  1.e-004
Var   ValueGradient   |Var   ValueGradient   |Var   Value
Gradient   
  1-56.9607 -1.2327e-005 |  2 -3.7159 -5.7984e-005 |
 inner maxg = 9.681e-005
max separable g 9.681e-005
Newton raphson 1
 f = 971.7651636 max g = 9.245773036e-010
max separable g 9.245775812e-010
Newton raphson 2
 f = 971.7651636 max g = 2.220446049e-015
971.7651636
Error in glmm.admb(y ~ treat, random = ~1, group = "subject", impSamp = 
100,  :
  The function maximizer failed
In addition: Warning message:
In shell(paste(.path.package("glmmADMB"), "/admb/", file_name, ".exe",  :
  'cmd' execution failed with error code 1
 >

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] AD-MB problem in package:glmmADMB

2008-03-29 Thread coldeyes.Rhelp
Hi here,
i recently notice the software built by otter company  know as AD-MB 
tools . i explore a little bit this tools under  the R Package for mixed 
logistics model. it is a very interesting tool. but i get several questions.

first question: i tried the R code below, and have the error , i can run 
the code for switching the setting to impSamp=0 , it means i can only 
run the code under Laplace approximation but importance sampling.  does  
anyone  have same problem here ?

second question: although i used save.dir=NULL option , but i can not 
see the folder which saves the intermedia output, i didn't find the 
nbmm.std file which save the BLUP. the strangest thing is i can see a 
temporary folder name as _glmm_ADMB_temp_dir_ when programing is running 
, but this fold mysteriously disappeared after the programing done . 
searched the whole computer desn't find any clue.

I posted my output below.

I really appreciate if you can help me with the questions.

source("http://www.mi.uib.no/~skaug/cash/lesaffre_dat.s 
")
fit_glmmADMB_ip <- glmm.admb(y~treat,random=~1,group="subject",impSamp 
=100,data=lesaffre,family="binomial",link="logit",save.dir= NULL)

Initial statistics: 2 variables; iteration 0; function evaluation 0
Function value 1.5926934e+003; maximum gradient component mag 1.2500e+001
Var Value Gradient |Var Value Gradient |Var Value Gradient
1 0. 1.2500e+001 | 2 0. 6.2441e-001 |

- final statistics:
2 variables; iteration 9; function evaluation 13
Function value 1.2593e+003; maximum gradient component mag -5.7984e-005
Exit code = 1; converg criter 1.e-004
Var Value Gradient |Var Value Gradient |Var Value Gradient
1-56.9607 -1.2327e-005 | 2 -3.7159 -5.7984e-005 |
inner maxg = 9.681e-005
max separable g 9.681e-005
Newton raphson 1
f = 971.7651636 max g = 9.245773036e-010
max separable g 9.245775812e-010
Newton raphson 2
f = 971.7651636 max g = 2.220446049e-015
971.7651636
Error in glmm.admb(y ~ treat, random = ~1, group = "subject", impSamp = 
100, :
The function maximizer failed
In addition: Warning message:
In shell(paste(.path.package("glmmADMB"), "/admb/", file_name, ".exe", :
'cmd' execution failed with error code 1

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] question for Logic Regression

2008-05-18 Thread coldeyes.Rhelp

Hi All:

how to get the coefficient for logic regression using selection=2 ( fit 
multiple models) and type=3 ( logistic regression)

for example i have a fit like below :
fit<-logreg(resp = model.dat[,21], bin=model.dat[, 
2:18],sep=model.dat[,1] ,type=3,select=2,ntrees=2,nleaves=6 
,anneal.control=Annealing,tree.control=TreeControl)


i try to use  fit$coef  but i get nothing.

and i try to use eval.logreg to evaluate a validate data "model.dat2", 
but i cannot fit "model" class make below formula work

alltrees <- eval.logreg(fit$model , model.dat2)

could anyone enlighten me a little.
thanks
leo

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] some question about partial prediction in survival

2007-10-14 Thread coldeyes.Rhelp
Hi there:
i got a problem to get the prediction from a model recently.  for 
example if i use a survival analysis to predict the risk. i use the code 
like below: i found the the prediction is not equal to (coef * x + coef 
* sex) , could someone help me with why this happened? and  can someone 
explain to me how this command "predict(f, type="terms")" works? is 
every partial prediction equal to coef*x=predict(f,type="terms")[,1] and 
coef*sex=predict(f,type="terms")[,2]?  it looks like they did not match.
however 
"predict(f)=predict(f,type="terms")[,1]+predict(f,type="terms")[,2]"
how should i understand this. thanks so much for your help

test1 <- list(time=  c(4, 1,1,2,2,3),
status=c(1,1,0,1,1,0),
x= c(0,1,1,1,0,0),
sex=   c(0,0,0,1,1,1))
f<-coxph( Surv(time, status) ~ x + sex, test1)

Call:
coxph(formula = Surv(time, status) ~ x + sex, data = test1)


  coef exp(coef) se(coef)  zp
x1.713 5.546 1.34  1.282 0.20
sex -0.154 0.857 1.45 -0.106 0.92

Likelihood ratio test=1.85  on 2 df, p=0.397  n= 6

bests;
T.D

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.