[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. pkgs <- c('sas7bdat', 'betareg', 'lmtest') lapply(pkgs, require, character.only = T) df1 <- read.sas7bdat("lgd.sas7bdat") df2 <- df1[which(df1$y < 1), ] xvar <- paste("x", 1:7, sep = '', collapse = " + ") fml1 <- as.formula(paste("y ~ ", xvar)) fml2 <- as.formula(paste("y ~ ", xvar, "|", xvar)) # FIT A BETA MODEL WITH THE FIXED PHI beta1 <- betareg(fml1, data = df2) summary(beta1) # Coefficients (mean model with logit link): # Estimate Std. Error z value Pr(>|z|) # (Intercept) -1.500242 0.329670 -4.551 5.35e-06 *** # x1 0.007516 0.026020 0.289 0.772680 # x2 0.429756 0.135899 3.162 0.001565 ** # x3 0.099202 0.022285 4.452 8.53e-06 *** # x4 2.465055 0.415657 5.931 3.02e-09 *** # x5 -0.003687 0.001070 -3.446 0.000568 *** # x6 0.007181 0.001821 3.943 8.06e-05 *** # x7 0.128796 0.186715 0.690 0.490319 # # Phi coefficients (precision model with identity link): # Estimate Std. Error z value Pr(>|z|) # (phi) 3.6868 0.1421 25.95 <2e-16 [...]
[Read more...]