The goodness of fit results assesses how well the model fits the data. It consists of measures of the resemblance between the observed and the expected data, and the parsimony of the model.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ```
goodnessfit(object,...)
## S3 methods
## Default S3 method:
goodnessfit(object, ...)
## S3 method for class 'lba.ls'
goodnessfit(object, ...)
## S3 method for class 'lba.ls.fe'
goodnessfit(object, ...)
## S3 method for class 'lba.ls.logit'
goodnessfit(object, ...)
## S3 method for class 'lba.mle'
goodnessfit(object, ...)
## S3 method for class 'lba.mle.fe'
goodnessfit(object, ...)
## S3 method for class 'lba.mle.logit'
goodnessfit(object, ...)
``` |

`object` |
An object of one of following classes: |

`...` |
Further arguments (required by generic). |

The `goodnessfit`

function of the method `lba.mle`

, `lba.mle.fe`

and `lba.mle.logit`

returns a list with the slots:

`dfdb ` |
Degrees of freedom of the base model |

`dfd ` |
Degrees of freedom of the full model |

`G2b ` |
Likelihood ratio statistic of the base model |

`G2 ` |
Likelihood ratio statistic of the full model |

`chi2b ` |
Chi-square statistic of the base model |

`chi2 ` |
Chi-square statistic of the full model |

`proG1 ` |
P-value of likelihood ratio statistic of the base model |

`proG ` |
P-value of likelihood ratio statistic of the full model |

`prochi1 ` |
P-value of chi-square statistic of the base model |

`prochi ` |
P-value of chi-square statistic of the full model |

`AICb ` |
AIC criteria of the base model |

`AICC ` |
AIC criteria of the full model |

`BICb ` |
BIC criteria of the base model |

`BICC ` |
BIC criteria of the full model |

`CAICb ` |
CAIC criteria of the base model |

`CAIC ` |
CAIC criteria of the full model |

`delta1 ` |
Normed fit index |

`delta2 ` |
Normed fit index modified |

`rho1 ` |
Bollen index |

`rho2 ` |
Tucker-Lewis index |

`RSS1 ` |
Residual sum of square of the base model |

`RSS ` |
Residual sum of square of the full model |

`impRSS ` |
Improvement of RSS |

`impPB ` |
Improvement per budget |

`impDF ` |
Average improvement per degree of freedom |

`D1 ` |
Index of dissimilarity of the base model |

`D ` |
Index of dissimilarity of the full model |

`pccb ` |
Proportion of correctly classified data of the base model |

`pcc ` |
Proportion of correctly classified data of the full model |

`impD ` |
Improvement of proportion of correctly classified data |

`impPCCB ` |
Improvement of Proportion of correctly classified data per budget |

`AimpPCCDF` |
Average improvement of Proportion of correctly classified data per degree of freedom |

`mad1 ` |
Mean angular deviation of the base model |

`madk ` |
Mean angular deviation of the full model |

`impMad ` |
Improvement mean angular deviation |

`impPBsat ` |
Improvement mean angular deviation per budget |

`impDFsat ` |
Average improvement mean angular deviation per degree of freedom |

The `goodnessfit`

function of the method `lba.ls`

, `lba.ls.fe`

and `lba.ls.logit`

returns a list with the slots:

`dfdb ` |
Degrees of freedom of the base model |

`dfd ` |
Degrees of freedom of the full model |

`RSS1 ` |
Residual sum of square of the base model |

`RSS ` |
Residual sum of square of the full model |

`impRSS ` |
Improvement of RSS |

`impPB ` |
Improvement per budget |

`impDF ` |
Average improvement per degree of freedom |

`D1 ` |
Index of dissimilarity of the base model |

`D ` |
Index of dissimilarity of the full model |

`pccb ` |
Proportion of correctly classified data of the base model |

`pcc ` |
Proportion of correctly classified data of the full model |

`impD ` |
Improvement of proportion of correctly classified data |

`impPCCB ` |
Improvement of Proportion of correctly classified data per budget |

`AimpPCCDF` |
Average improvement of Proportion of correctly classified data per degree of freedom |

`mad1 ` |
Mean angular deviation of the base model |

`madk ` |
Mean angular deviation of the full model |

`impMad ` |
Improvement mean angular deviation |

`impPBsat ` |
Improvement mean angular deviation per budget |

`impDFsat ` |
Average improvement mean angular deviation per degree of freedom |

For a detailed and complete discussion about goodness of fit results for latent budget analysis, see van der Ark 1999.

Agresti, Alan. 2002. *Categorical Data Analysis, second edition*. Hoboken: John Wiley \& Sons.

van der Ark, A. L. 1999. *Contributions to Latent Budget Analysis, a tool for the analysis of compositional data*. Ph.D. Thesis University of Utrecht.

`summary.goodnessfit.lba.ls`

, `summary.goodnessfit.lba.mle`

,`lba`

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | ```
data('votB')
# Using LS method (default) without constraint
# K = 2
ex1 <- lba(parties ~ city,
votB,
K = 2)
gx1 <- goodnessfit(ex1)
gx1
# Using MLE method without constraint
# K = 2
exm <- lba(parties ~ city,
votB,
K = 2,
method='mle')
gxm <- goodnessfit(exm)
gxm
# Using LS method (default) with LOGIT constrain
data('housing')
# Make cross-table to matrix design.
tbh <- xtabs(value ~ Influence + Housing, housing)
Xis <- model.matrix(~ Housing*Influence,
tbh,
contrasts=list(Housing='contr.sum',
Influence='contr.sum'))
tby <- xtabs(value ~ Satisfaction + Contact, housing)
Yis <- model.matrix(~ Satisfaction*Contact,
tby,
contrasts=list(Satisfaction='contr.sum',
Contact='contr.sum'))[,-1]
S <- 12
T <- 5
tabs <- xtabs(value ~ interaction(Housing,
Influence) + interaction(Satisfaction,
Contact),
housing)
## Not run:
ex2 <- lba(tabs,
K = 2,
logitA = Xis,
logitB = Yis,
S = S,
T = T,
trace.lba=FALSE)
gex2 <- goodnessfit(ex2)
gex2
## End(Not run)
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.