Re: [R] question for Logic Regression

2008-05-19 Thread coldeyes

thanks for you response,  i try predict command, it is doesn't work. i list a
simulate code below:

X <- matrix(as.numeric(runif(400) < 0.5), 50,8) 
colnames(X) <- paste("X", 1:ncol(X), sep="") 
rownames(X) <- paste("case", 1:nrow(X), sep="")

# Define expected result: Y = (NOT X2) AND X6
Y <- as.numeric(!X[,2] & X[,6]) 

Z<-cbin(X,Y)

set.seed(12345)

Annealing <- logreg.anneal.control(start = 4, end = -4, iter = 1000, update
= 50)

logicfit <- logreg(resp=Z[,9], bin=Z[,1:8],
   type = 3,
   select = 2,
   ntrees=2,
   nleaves=3,  
   anneal.control=Annealing)

new<-data.frame(Z)
new<-NULL
alltrees <- predict(logicfit, new) 

names(logicfit) 

doesn't have coef class. 

thanks




Yasir Kaheil wrote:
> 
> try
> alltrees <- predict(fit, model.dat2) # make sure response variable is not
> included in model.dat2
> 
> also to see the other attributes in "fit", try: attributes(fit)
> 
> thanks
> y
> 
> 
> 
> coldeyes.Rhelp wrote:
>> 
>> 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.
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/question-for-Logic-Regression-tp17310610p17325671.html
Sent from the R help mailing list archive at Nabble.com.

__
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] How to get confidence interval and coefficient in Logic Regression

2008-05-19 Thread coldeyes Liao
sorry to bother everyone.
i have question to get the coefficient and confidence interval in Logic
Regression with Logistic model.  below i list the R code

X <- matrix(as.numeric(runif(400) < 0.5), 50,8)
colnames(X) <- paste("X", 1:ncol(X), sep="")
rownames(X) <- paste("case", 1:nrow(X), sep="")
# Define expected result: Y = (NOT X1) AND X5
Y <- as.numeric(!X[,1] & X[,5])
z<-as.numeric(runif(50))

model.dat<-cbind(X,z,Y)

set.seed(12345)
Annealing <- logreg.anneal.control(start = 4, end = -4, iter = 1000, update
= 50)
logicfit <- logreg(resp=model.dat[,10],
bin=model.dat[,1:8],sep=model.dat[,9],
   type = 3,
   select = 2,
   ntrees=2,
   nleaves=3,
   anneal.control=Annealing)

use names(logicfit)  ,  i didn't see coef  class. how to i get the
coefficient of the model , especially for the additive effect.
is there command i can  calculate the sd so that i can have confidence
interval.

model.dat2<-model.dat
secondly i try to use alltrees <- eval.logreg(logicfit , model.dat2)  to
score a new data set model.dat2. but this doesn't work.

thanks for your help.
leo

[[alternative HTML version deleted]]

__
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] how to reset slogic.f file

2008-03-18 Thread coldeyes Liao
Hi there:
recently i try to use LogicReg  package  for a  tree  model(logistics fit )
. i list my code and error below:

> dim(model.dat)
[1] 48000   745
> fit1 <- logreg(resp = model.dat[,745], bin=model.dat[, 9:700], type = 3,
select = 3, ntrees = c(1,2), nleaves=c(1,7), )
Insufficient declaration
LGCn1MAX in logreg() is2
LGCn1MAX should be at least 48000
Please fix and recompile

i find the help file which said i need to reset them in *slogic.f* and
recompile if  the parameters are not large enough. but i cann't find the
slogic.f .
could you enlight me where i can find it  if i run R under linux server.
for recompile this file,  should i contact with administrator?

thanks so much !
leo

[[alternative HTML version deleted]]

__
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.