Error in SelectInput

Well done! We are almost solved! thanks bro.
radiobutton and select2 inputs response when i change them. But, whenever i change select1, web view closed that is probably last problem.

this is what r said about error:

Warning in glm.fit(x = numeric(0), y = numeric(0), weights = NULL, start = NULL, :
no observations informative at iteration 1
Warning: glm.fit: algorithm did not converge
Warning: Error in glm.fit: 'fit' nesnesi bulunamadı
78: glm.fit
75: glm
74: probitmfxest
73: probitmfx
72: observeEventHandler [C:\Users\Administrator\Desktop\R studies\Yeni klasör\WEBAP/app.R#74]
1: runApp

This error is related to mathematical model, it has nothing to do with app. The choice for select1 makes model infeasible(incorrect) hence, the error. If you search for it, you may get the causes.
Possible causes of the error I found on web:-

  1. Convergence problem arises when no. of parameters are more than relative no. data points.
  2. Trying to predict something by itself.
  3. Typo in the function.

Can you share the dataset?

I understood that it is about data. I will solve this if i can integrated pre-data manipulation part (which are the ** stars codes) into observe function. How can we do this? i'm sure that if we solve this integration, it will be done!

observe({
a<-Book %>% filter(Urun==(input$select1) & Ilce==(input$select2))

** aa<-a%>% filter( AlarmSayisi<= 100,TeknikDestekTalebi<= 15, MobilDataKullanimi<=30)**
** aa$MobilDataKullanimi <- ifelse(aa$MobilDataKullanimi>1,1,0)**
** aa$HizmetSuresi <- aa$HizmetSuresi/12**
** aa$HizmetSuresi3<-ifelse(aa$HizmetSuresi<=3,1,0)**
** aa$SikayetSayisi[aa$SikayetSayisi >=1] <-1**
** aa$TeknikDestekTalebi<-ifelse(aa$TeknikDestekTalebi>1,1,0)**
** aa$IndirimOrani<-as.numeric(aa$IndirimOrani)**
** aa$IndirimOrani<-aa$IndirimOrani*100**
** aa$IndirimOrani[aa$IndirimOrani>0]<-1**
** aa$IndirimOrani[is.na(aa$IndirimOrani)]=0**
** aa$CHURN<-recode(aa$CHURN,"VAR"=1, "YOK"=0)**
** aa$CHURN<-as.numeric(aa$CHURN)**

    observeEvent(input$mltype,{
        if(input$mltype=="probitmfx"){
            res <- probitmfx(formula=CHURN~ HizmetSuresi3+SikayetSayisi+TeknikDestekTalebi+MobilDataKullanimi+IndirimOrani
                             ,data = aa, 
                             atmean = TRUE, robust = FALSE, clustervar1 = NULL, 
                             clustervar2 = NULL, start = NULL, control = list())
        }
        if(input$mltype=="logitmfx"){
            res <- logitmfx(formula=CHURN~ HizmetSuresi3+SikayetSayisi+TeknikDestekTalebi+MobilDataKullanimi+IndirimOrani
                            ,data = aa, 
                            atmean = TRUE, robust = FALSE, clustervar1 = NULL, 
                            clustervar2 = NULL, start = NULL, control = list())
        }


res1<-as.data.frame(res$mfxest)
pi<-select(res1,`dF/dx`,`P>|z|`)

by the way, the codes ,which is below, contained select1 and select2 which contain "CHARACTER VALUES"

So,
in order to run dplyr package or filter in the code in top, there should be " " in the parenthesizes, you know. Is the problem about this?

I think you should let the names be a,

observeEvent(input$mltype,{
a<-Book %>% filter(Urun==(input$select1) & Ilce==(input$select2))
 a<-a%>% filter( AlarmSayisi<= 100,TeknikDestekTalebi<= 15, MobilDataKullanimi<=30)
 a$MobilDataKullanimi <- as.numeric(as.character(a$MobilDataKullanimi)) # if column has factor then use this or as.numeric is sufficient
a$MobilDataKullanimi <- ifelse(a$MobilDataKullanimi>1,1,0)
a$HizmetSuresi <- as.numeric(as.character(a$HizmetSuresi))
 a$HizmetSuresi <- a$HizmetSuresi/12
a$HizmetSuresi3 <- as.numeric(as.character(a$HizmetSuresi3))
 a$HizmetSuresi3<-ifelse(a$HizmetSuresi<=3,1,0)
 a$SikayetSayisi <- as.numeric(as.character(a$SikayetSayisi))
 a$SikayetSayisi[a$SikayetSayisi >=1] <-1
 a$TeknikDestekTalebi <- as.numeric(as.character(a$TeknikDestekTalebi))
 a$TeknikDestekTalebi<-ifelse(a$TeknikDestekTalebi>1,1,0)
 a$IndirimOrani<-as.numeric(a$IndirimOrani)
 a$IndirimOrani<-a$IndirimOrani*100
 a$IndirimOrani[a$IndirimOrani>0]<-1
 a$IndirimOrani[is.na(a$IndirimOrani)]=0
 a$CHURN<-recode(a$CHURN,"VAR"=1, "YOK"=0)
 a$CHURN<-as.numeric(a$CHURN)
bserveEvent(input$mltype,{
        if(input$mltype=="probitmfx"){
            res <- probitmfx(formula=CHURN~ HizmetSuresi3+SikayetSayisi+TeknikDestekTalebi+MobilDataKullanimi+IndirimOrani
                             ,data = a, 
                             atmean = TRUE, robust = FALSE, clustervar1 = NULL, 
                             clustervar2 = NULL, start = NULL, control = list())
        } 
# rest of the code

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.