Re: [R] question for Logic Regression

From: coldeyes <coldeyes.rhelp_at_gmail.com>
Date: Mon, 19 May 2008 11:59:58 -0700 (PDT)

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_at_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_at_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.
Received on Mon 19 May 2008 - 19:02:55 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 19 May 2008 - 22:30:44 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive