diff --git a/R/poLCA.R b/R/poLCA.R index 35d3949..b3a3b7e 100644 --- a/R/poLCA.R +++ b/R/poLCA.R @@ -159,6 +159,7 @@ function(formula,data,nclass=2,maxiter=1000,graphs=FALSE,tol=1e-10, ret$npar <- (R*sum(K.j-1)) + (R-1) # number of degrees of freedom used by the model (number of estimated parameters) if (S>1) { ret$npar <- ret$npar + (S*(R-1)) - (R-1) } ret$aic <- (-2 * ret$llik) + (2 * ret$npar) # Akaike Information Criterion + ret$sabic <- (-2 * ret$llik) + (log((N + 2) / 24) * ret$npar) ret$bic <- (-2 * ret$llik) + (log(N) * ret$npar) # Schwarz-Bayesian Information Criterion ret$Nobs <- sum(rowSums(y==0)==0) # number of fully observed cases (if na.rm=F) if (all(rowSums(y==0)>0)) { # if no rows are fully observed diff --git a/R/print.poLCA.R b/R/print.poLCA.R index 0c5098d..c7d71bf 100644 --- a/R/print.poLCA.R +++ b/R/print.poLCA.R @@ -28,6 +28,7 @@ function(x, ...) { cat("maximum log-likelihood:", x$llik, "\n \n") cat("AIC(",R,"): ",x$aic,"\n",sep="") cat("BIC(",R,"): ",x$bic,"\n",sep="") + cat("SABIC(",R,"): ",x$sabic,"\n",sep="") if (S==1) cat("G^2(",R,"): ",x$Gsq," (Likelihood ratio/deviance statistic) \n",sep="") cat("X^2(",R,"): ",x$Chisq," (Chi-square goodness of fit) \n \n",sep="") if (x$numiter==x$maxiter) cat("ALERT: iterations finished, MAXIMUM LIKELIHOOD NOT FOUND \n \n") diff --git a/man/poLCA.Rd b/man/poLCA.Rd index 3429e1d..d1e0160 100644 --- a/man/poLCA.Rd +++ b/man/poLCA.Rd @@ -48,6 +48,7 @@ Model specification: Latent class models have more than one manifest variable, s \item{coeff.V}{covariance matrix of coefficient estimates on covariates (when estimated).} \item{aic}{Akaike Information Criterion.} \item{bic}{Bayesian Information Criterion.} +\item{sabic}{Sample-Size adjusted Bayesian Information Criterion.} \item{Gsq}{Likelihood ratio/deviance statistic.} \item{Chisq}{Pearson Chi-square goodness of fit statistic for fitted vs. observed multiway tables.} \item{time}{length of time it took to run the model.}