(This article was first published on

**Yet Another Blog in Statistical Computing » S+/R**, and kindly contributed to R-bloggers)library(party) df1 <- read.csv("credit_count.csv") df2 <- df1[df1$CARDHLDR == 1, ] mdl <- mob(DEFAULT ~ MAJORDRG + MINORDRG + INCOME + OWNRENT | AGE + SELFEMPL, data = df2, family = binomial(), control = mob_control(minsplit = 1000), model = glinearModel) print(mdl) #1) AGE <= 22.91667; criterion = 1, statistic = 48.255 # 2)* weights = 1116 #Terminal node model #Binomial GLM with coefficients: #(Intercept) MAJORDRG MINORDRG INCOME OWNRENT # -0.6651905 0.0633978 0.5182472 -0.0006038 0.3071785 # #1) AGE > 22.91667 # 3)* weights = 9383 #Terminal node model #Binomial GLM with coefficients: #(Intercept) MAJORDRG MINORDRG INCOME OWNRENT # -1.4117010 0.2262091 0.2067880 -0.0003822 -0.2127193 ### TEST FOR STRUCTURAL CHANGE ### sctest(mdl, node = 1) # AGE SELFEMPL #statistic 4.825458e+01 20.88612025 #p.value 1.527484e-07 0.04273836 summary(mdl, node = 2) #Coefficients: # Estimate Std. Error z value Pr(>|z|) #(Intercept) -0.6651905 0.2817480 -2.361 0.018229 * #MAJORDRG 0.0633978 0.3487305 0.182 0.855743 #MINORDRG 0.5182472 0.2347656 2.208 0.027278 * #INCOME -0.0006038 0.0001639 -3.685 0.000229 *** #OWNRENT 0.3071785 0.2028491 1.514 0.129945 summary(mdl, node = 3) #Coefficients: # Estimate Std. Error z value Pr(>|z|) #(Intercept) -1.412e+00 1.002e-01 -14.093 < 2e-16 *** #MAJORDRG 2.262e-01 7.067e-02 3.201 0.00137 ** #MINORDRG 2.068e-01 4.925e-02 4.199 2.68e-05 *** #INCOME -3.822e-04 4.186e-05 -9.131 < 2e-16 *** #OWNRENT -2.127e-01 7.755e-02 -2.743 0.00609 **

To

**leave a comment**for the author, please follow the link and comment on their blog:**Yet Another Blog in Statistical Computing » S+/R**.R-bloggers.com offers

**daily e-mail updates**about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...