Welcome to MLink Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
252 views
in Technique[技术] by (71.8m points)

I am stuck with R program


 C=function(a0,a1){
      x<-c(0,1);N1=F1=F2=array(0,dim=c(2,7));K=array(0,dim=c(2,7));N2=array(0,dim=c(2,7))
 for(i in 1:2){  
 for(j in 1:7){
N1[i,j]=n1[i,j]+n12[i,j]; K[i,j]=n1[i,j]+n2[i,j]+n12[i,j]+n0[i,j]; N2[i,j]=n2[i,j]+n12[i,j];

F1[i,j]=N1[i,j]/K[i,j]

F2[i,j]=N2[i,j]/K[i,j]

      alpha=exp(a0+a1*x[i])+1

     c<-exp(-((-log(F1))^(alpha)+((-log(F2))^(alpha))^(1/alpha)))
}}
return(c)
} 
 

I am getting error when this loop is runing

Error: object 'K' not found
Error: object 'N2' not found

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to MLink Developer Q&A Community for programmer and developer-Open, Learning and Share
...