please help me
 
again I have a problem. 
 
I want to do cross-validation for multinomial log. reg. I have a response 
variabe with 7 levels (Z((a,b,c,d,e,f,g)) and 4 predictor(1 classifier and 3 
continuous). I did:
 
#data with 100 observations
 
> library('bootstrap')
 
>x<-matrix(c(data$H, data$K, data$P, data$W),100,4)
>y<-data$Z
>theta.fit <- function(x,y){lsfit(x,y)}
>theta.predict <- function(fit,x){cbind(1,x)%*%fit$coef}
>sq.err <- function(y,yhat) { (y-yhat)^2}  
>results <- bootpred(x,y,50,theta.fit,theta.predict, sq.err)           
>miss.clas <- function(y,yhat){ 1*(yhat!=y)}
>results <- bootpred(x,y,50,theta.fit,theta.predict, miss.clas)
 
 
do this form correct for my data?
if yes;
but why after both results, R give me error?
Error in lsfit(x, y) : NA/NaN/Inf in foreign function call (arg 1)
In addition: Warning messages:
1: In storage.mode(x) <- "double" : NAs introduced by coercion
2: In storage.mode(y) <- "double" : NAs introduced by coercion

 
Thanks alot
 
Azam
 

 
 


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

Reply via email to