[This article was first published on Yet Another Blog in Statistical Computing » S+/R, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here) Want to share your content on R-bloggers? click here if you have a blog, or here if you don't. library(betareg) library(sas7bdat) df1 <- read.sas7bdat('lgd.sas7bdat') df2 <- df1[df1$y < 1, ] fml <- as.formula('y ~ x2 + x3 + x4 + x5 + x6 | x3 + x4 | x1 + x2') ### LATENT-CLASS BETA REGRESSION: AIC = -565 ### mdl1 <- betamix(fml, data = df2, k = 2, FLXcontrol = list(iter.max = 500, minprior = 0.1)) print(mdl1) #betamix(formula = fml, data = df2, k = 2, FLXcontrol = list(iter.max = 500, # minprior = 0.1)) # #Cluster sizes: # 1 2 #157 959 summary(mdl1, which = 'concomitant') # Estimate Std. Error z value Pr(>|z|) #(Intercept) -1.35153 0.41988 -3.2188 0.001287 ** #x1 2.92537 1.13046 2.5878 0.009660 ** #x2 2.82809 1.42139 1.9897 0.046628 * summary(mdl1) #$Comp.1$mean # Estimate Std. Error z value Pr(>|z|) #(Intercept) -0.8963228 1.0385545 -0.8630 0.3881108 #x2 3.1769062 0.6582108 4.8266 1.389e-06 *** #x3 -0.0520060 0.0743714 -0.6993 0.4843805 #x4 4.9642998 1.4204071 3.4950 0.0004741 *** #x5 0.0021647 0.0022659 0.9554 0.3393987 #x6 0.0248573 [...]
[Read more...]