Title: | Latent Budget Analysis for Compositional Data |
---|---|
Description: | Latent budget analysis is a method for the analysis of a two-way contingency table with an exploratory variable and a response variable. It is specially designed for compositional data. |
Authors: | Enio G. Jelihovschi <[email protected]> and Ivan Bezerra Allaman <[email protected]> |
Maintainer: | Ivan Bezerra Allaman <[email protected]> |
License: | GPL (>= 2) |
Version: | 2.4.52 |
Built: | 2025-02-21 03:44:47 UTC |
Source: | https://github.com/ivanalaman/lba |
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.
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, ...)
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 and 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
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)
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)
The housing
data frame has 72 rows and 5 columns.
The observations were obtained from an investigation of Satisfaction with housing conditions carried out by the Danish Building Research Institute and the Danish Institute of Mental Health Research.
data(housing)
data(housing)
This data frame contains the following columns:
A factor with levels:
Apartment
;
Atrium
;
Terraced
;
Tower
.
A factor with levels:
hi
;
low
;
med
.
A factor with levels:
high
;
low
.
A factor with levels:
hi
;
low
;
med
.
The absolute frequencies of which factor.
Madsen, M. (1976) Statistical analysis of multiple contingency tables: Two examples. Scandinavian Journal of Statistics 3, 97–106.
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.
Latent budget analysis (LBA) is a method for the analysis of contingency tables, from where the compositional data is derived. It is used to understand the relationship between the table rows and columns, where the rows denote the categories of the explanatory variable and the columns denote the categories of the response variable.
The row vectors of the compositional data are called observed budgets which are approximated by the expected budgets. The LBA allows us to find which categories of the response are related to different groups of the explanatory categories. If the table has a product multinomial distribution we can understand the latent budget model (LBM) as explaining the relationship between the explanatory and the response variables assuming that conditioned on the latent variable they are independent. In that sense, the latent budgets, which are categories of a latent variable, are hidden values which explain the relationship between the explanatory and response variables. LBA reduce the dimensionality of the original problem, thus making it easier to understand its hidden relations.
Enio G. Jelihovschi <[email protected]> and Ivan Bezerra Allaman <[email protected]>. We are grateful to Jose C. Faria, Andreas L. van der Ark and Fabio M. Correa for suggestions.
Maintainer: Enio G. Jelihovschi <[email protected]>
Latent budget analysis (LBA) is a method for the analysis of contingency tables, from where the compositional data is derived. It is used to understand the relationship between the table rows and columns, where the rows denote the categories of the explanatory variable and the columns denote the categories of the response variable.
lba(obj, ...) ## S3 method for class 'matrix' lba(obj, A = NULL, B = NULL, K = 1L, cA = NULL, cB = NULL, logitA = NULL, logitB = NULL, omsk = NULL, psitk = NULL, S = NULL, T = NULL, row.weights = NULL, col.weights = NULL, tolG = 1e-10, tolA = 1e-05, tolB = 1e-05, itmax.unide = 1e3, itmax.ide = 1e3, trace.lba = TRUE, toltype = "all", method = c("ls", "mle"), what = c("inner","outer"), ...) ## S3 method for class 'table' lba(obj, A = NULL, B = NULL, K = 1L, cA = NULL, cB = NULL, logitA = NULL, logitB = NULL, omsk = NULL, psitk = NULL, S = NULL, T = NULL, row.weights = NULL, col.weights = NULL, tolG = 1e-10, tolA = 1e-05, tolB = 1e-05, itmax.unide = 1e3, itmax.ide = 1e3, trace.lba = TRUE, toltype = "all", method = c("ls", "mle"), what = c("inner","outer"), ...) ## S3 method for class 'formula' lba(formula, data, A = NULL, B = NULL, K = 1L, cA = NULL, cB = NULL, logitA = NULL, logitB = NULL, omsk = NULL, psitk = NULL, S = NULL, T = NULL, row.weights = NULL, col.weights = NULL, tolG = 1e-10, tolA = 1e-05, tolB = 1e-05, itmax.unide = 1e3, itmax.ide = 1e3, trace.lba = TRUE, toltype = "all", method = c("ls", "mle"), what = c("inner","outer"), ...) ## S3 method for class 'ls' lba(obj, A , B , K , row.weights , col.weights , tolA , tolB , itmax.unide , itmax.ide , trace.lba , what , ...) ## S3 method for class 'mle' lba(obj, A , B , K , tolG , tolA , tolB , itmax.unide , itmax.ide , trace.lba , toltype , what , ...) ## S3 method for class 'ls.fe' lba(obj, A , B , K , cA , cB , row.weights , col.weights , itmax.ide , trace.lba , ...) ## S3 method for class 'mle.fe' lba(obj, A , B , K , cA , cB , tolG , tolA , tolB , itmax.ide , trace.lba , toltype , ...) ## S3 method for class 'ls.logit' lba(obj, A , B , K , cA , cB , logitA , logitB , omsk , psitk , S , T , row.weights , col.weights , itmax.ide , trace.lba , ...) ## S3 method for class 'mle.logit' lba(obj, A , B , K , cA , cB , logitA , logitB , omsk , psitk , S , T , itmax.ide , trace.lba , ...)
lba(obj, ...) ## S3 method for class 'matrix' lba(obj, A = NULL, B = NULL, K = 1L, cA = NULL, cB = NULL, logitA = NULL, logitB = NULL, omsk = NULL, psitk = NULL, S = NULL, T = NULL, row.weights = NULL, col.weights = NULL, tolG = 1e-10, tolA = 1e-05, tolB = 1e-05, itmax.unide = 1e3, itmax.ide = 1e3, trace.lba = TRUE, toltype = "all", method = c("ls", "mle"), what = c("inner","outer"), ...) ## S3 method for class 'table' lba(obj, A = NULL, B = NULL, K = 1L, cA = NULL, cB = NULL, logitA = NULL, logitB = NULL, omsk = NULL, psitk = NULL, S = NULL, T = NULL, row.weights = NULL, col.weights = NULL, tolG = 1e-10, tolA = 1e-05, tolB = 1e-05, itmax.unide = 1e3, itmax.ide = 1e3, trace.lba = TRUE, toltype = "all", method = c("ls", "mle"), what = c("inner","outer"), ...) ## S3 method for class 'formula' lba(formula, data, A = NULL, B = NULL, K = 1L, cA = NULL, cB = NULL, logitA = NULL, logitB = NULL, omsk = NULL, psitk = NULL, S = NULL, T = NULL, row.weights = NULL, col.weights = NULL, tolG = 1e-10, tolA = 1e-05, tolB = 1e-05, itmax.unide = 1e3, itmax.ide = 1e3, trace.lba = TRUE, toltype = "all", method = c("ls", "mle"), what = c("inner","outer"), ...) ## S3 method for class 'ls' lba(obj, A , B , K , row.weights , col.weights , tolA , tolB , itmax.unide , itmax.ide , trace.lba , what , ...) ## S3 method for class 'mle' lba(obj, A , B , K , tolG , tolA , tolB , itmax.unide , itmax.ide , trace.lba , toltype , what , ...) ## S3 method for class 'ls.fe' lba(obj, A , B , K , cA , cB , row.weights , col.weights , itmax.ide , trace.lba , ...) ## S3 method for class 'mle.fe' lba(obj, A , B , K , cA , cB , tolG , tolA , tolB , itmax.ide , trace.lba , toltype , ...) ## S3 method for class 'ls.logit' lba(obj, A , B , K , cA , cB , logitA , logitB , omsk , psitk , S , T , row.weights , col.weights , itmax.ide , trace.lba , ...) ## S3 method for class 'mle.logit' lba(obj, A , B , K , cA , cB , logitA , logitB , omsk , psitk , S , T , itmax.ide , trace.lba , ...)
obj , formula
|
The function is generic, accepting some forms of the principal argument for specifying a two-way frequency table. Currently accepted forms are matrix, data frame (coerced to frequency tables), objects of class |
data |
A data frame containing variables in |
A |
The starting value of a (I x K) matrix containing the mixing parameters, if given. The default is |
B |
The starting value of a (J x K) matrix containing the latent components, if given. The default is |
K |
Integer giving the number of latent budgets chosen by the user. The default is |
cA |
The value of a (I x K) matrix containing the constraints on the mixing parameters. Fixed constraints are the values themselves which are numbers in the [0,1] interval. The optional equality constraints are indicated by an integer starting from 2, such that parameters that must be equal have the same integer. The default is |
cB |
The value of a (J x K) matrix containing the constraints on the latent components. Fixed constraints are the values themselves which are numbers in the [0,1] interval. The optional equality constraints are indicated by an integer starting from 2, such that parameters that must be equal have the same integer. The default is |
logitA |
Design (IxS) matrix for row-covariates. The first column contains the one number, indicating a constant covariate. The entries may be continuous or dummy coded values. |
logitB |
Design (JxT) matrix for column-covariates. The entries may be continuous or dummy coded values. |
omsk |
A (SxK) matrix giving the starting values for the multinomial logit parameters of the row covariates. The default is |
psitk |
A (TxK) matrix giving the starting values for the multinomial logit parameters of the column covariates. The default is |
S |
Number of row-covariates. The default is |
T |
Number of column-covariates. The default is |
row.weights |
A vector with the same number of rows of the matrix of the weighted least squares method. If is
. |
col.weights |
A vector with the same number of columns of the matrix of the weighted least squares method. If is
. |
tolG |
A tolerance value for judging when convergence has been reached. It is based on the estimated likelihood ratio statistics G2. The default is |
tolA |
A tolerance value for judging when convergence has been reached. When the one-iteration change in the maximum of the absolute value of the element wise difference of the estimated matrices A is less than tolA. The default is |
tolB |
A tolerance value for judging when convergence has been reached. When the one-iteration change in the maximum of the absolute value of the element wise difference of the estimated matrices B is less than tolB. The default is |
itmax.unide |
Maximum number of iterations performed by the mle or ls method, if convergence is not achieved, before identification parameters. The default is |
itmax.ide |
Maximum number of iterations performed by the mle or ls method in the identification process. Is used too when the constrained fixed, equality and logit are required. The default is |
trace.lba |
Logical, indicating whether the |
toltype |
String indicating which kind of tolerance to be used. That is, the EM algorithm stops updating and considers the maximum log-likelihood to have been found. Their types are: |
method |
String indicating which kind of estimating method. They are: |
what |
String indicating which kind identified solutions for mixing parameters and latent budgets matrices. They are: the |
... |
Further arguments (required by generic). |
The method lba.ls
and lba.mle
returns a list of class lba.ls
and lba.mle
respectively with the slots:
P |
The compositional data matrix which is formed by dividing the raw data matrix by their corresponding total, its rows are called observed budgets. |
pij |
Matrix whose rows are the expected budgets. |
residual |
Residual matrix |
A |
(I x K) matrix of the unidentified the mixing parameters. |
B |
(J x K) matrix of the unidentified the latent components. |
Aoi |
(I x K) matrix of the identified mixing parameters, they may be either the inner extreme values or the outer extreme values. |
Boi |
(J x K) matrix of the identified latent componentes, they may be either the inner extreme values or the outer extreme values. |
rescB |
(J x K) matrix of the rescaled latent components. |
pk |
Budget proportions. |
val_func |
Value of least squared or likelihood function achieved. |
iter_unide |
Number of unidentified iterations. |
iter_ide |
Number of identified iterations. |
The method lba.ls.fe
and lba.mle.fe
returns a list of class lba.ls.fe
and lba.mle.fe
respectively with the slots:
P |
The compositional data matrix which is formed by dividing the raw data matrix by their corresponding row total, its rows are called observed budgets. |
pij |
Matrix whose rows are the expected budgets. |
residual |
Residual matrix |
A |
(I x K) matrix of the unidentified the mixing parameters. |
B |
(J x K) matrix of the unidentified the latent components. |
rescB |
(J x K) matrix of the rescaled latent components. |
pk |
Budget proportions. |
val_func |
Value of least squared or likelihood function achieved. |
iter_ide |
Number of identified iteractions. |
The method lba.ls.logit
and lba.mle.logit
returns a list of class lba.ls.logit
and lba.mle.logit
respectively with the slots:
P |
The compositional data matrix which is formed by dividing the raw data matrix by their corresponding total, its rows are called observed budgets. |
pij |
Matrix whose rows are the expected budgets. |
residual |
Residual matrix |
A |
(I x K) matrix of the unidentified the mixing parameters. |
B |
(J x K) matrix of the unidentified the latent componentes. |
rescB |
(J x K) matrix of the rescaled latent components. |
pk |
Budget proportions. |
val_func |
Value of least squared or likelihood function achieved. |
iter_ide |
Number of identified iterations. |
omsk |
A (SxK) matrix giving estimated values of the multinomial logit parameters of the row covariates. |
psitk |
A (TxK) matrix giving the estimated values for the multinomial logit parameters of the column covariates. |
The user has two options to entry the data: the raw data and the tabulated data. If the raw data is imported, he may indicate which, among the variables, comprises the row and which the column variable and let the lba.formula
function make the tabulation. The user may also tabulate the data with the available functions in R. Recalling that if this second option is used, the object must be of the class xtabs
, table
or matrix
. If the user imports the tabulated data, the class is, in general, data.frame
and so, it is necessary to transform the object data into a matrix
.
The function lba
uses EM algorithm to maximise the latent budget model log-likelihood function; the Active Constraints Methods (ACM) to minimise either the weighted least squares (wls), or ordinary least squares (ols) functions; and "BFGS" variable metric method in constrOptim.nl
function of alabama package and in optim
function of stats package used in identification for K >= 3, in constraint algorithm for ls method, in multinomial logit constraints and in some parts of constraining for mle method. Depending on the starting parameters, those algorithms may only locate a local, rather than global, maximum. This becomes more and more of a problem as K, the number of latent budgets, increases. It is therefore highly advisable to run lba
multiple times until you are relatively certain that you have located the global maximum log-likelihood or the global minimum least squares.
Agresti, Alan. 2002. Categorical Data Analysis, second edition. Hoboken: John Wiley and Sons.
de Leeuw, J., and van der Heijden, P.G.M. 1988. "The analysis of time-budgets with a latent time-budget model". In E. Diday (Ed.), Data Analysis and Informatics V. pp. 159-166. Amsterdam: North-Holland.
de Leeuw, J., van der Heijden, P.G.M., and Verboon, P. 1990. "A latent time budget model". Statistica Neerlandica. 44, 1, 1-21.
Dempster, A.P., Laird, N.M., and Rubin, D.B. 1977. "Maximum likelihood from incomplete data via the EM algorithm". Journal of the Royal Statistical Society, Series. 39, 1-38.
van der Ark, A.L. 1999. Contributions to Latent Budget Analysis, a tool for the analysis of comositional data. Ph.D. Thesis University of Utrecht.
van der Heijden, P.G.M., Mooijaart, A., and de Leeuw, J. 1992. "Constrained latent budget analysis". In P.V. Marsden (Ed.), Sociological Methodology pp. 279-320. Cambridge: Blackwell Publishers.
goodnessfit
, summary.lba.ls
,summary.lba.mle
,plotlba
,plotcorr
data('votB') # Using LS method (default) without constraint # K = 2 ex1 <- lba(parties ~ city, votB, K = 2) ex1 # Already tabulated data? Ok! data('PerfMark') ## Not run: ex2 <- lba(as.matrix(PerfMark), K = 2, what='outer') ex2 ## End(Not run) # Using LS method (default) with constraint # Fixed constraint to mixing parameters cakiF1 <- matrix(c(0.2, NA, NA, NA , NA,0.2, NA , NA,0.2, 0.3, NA, NA, 0.2, NA, NA, NA , NA, NA), byrow = TRUE, ncol = 3) # K = 3 ## Not run: exf1 <- lba(parties ~ city, votB, cA = cakiF1, K = 3) exf1 ## End(Not run) # 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: exlogit2 <- lba(tabs, K = 2, logitA = Xis, logitB = Yis, S = S, T = T, trace.lba=FALSE) exlogit2 ## End(Not run)
data('votB') # Using LS method (default) without constraint # K = 2 ex1 <- lba(parties ~ city, votB, K = 2) ex1 # Already tabulated data? Ok! data('PerfMark') ## Not run: ex2 <- lba(as.matrix(PerfMark), K = 2, what='outer') ex2 ## End(Not run) # Using LS method (default) with constraint # Fixed constraint to mixing parameters cakiF1 <- matrix(c(0.2, NA, NA, NA , NA,0.2, NA , NA,0.2, 0.3, NA, NA, 0.2, NA, NA, NA , NA, NA), byrow = TRUE, ncol = 3) # K = 3 ## Not run: exf1 <- lba(parties ~ city, votB, cA = cakiF1, K = 3) exf1 ## End(Not run) # 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: exlogit2 <- lba(tabs, K = 2, logitA = Xis, logitB = Yis, S = S, T = T, trace.lba=FALSE) exlogit2 ## End(Not run)
The MANHATAN
data frame has 25 rows and 3 columns.
The observations were obtained in a study carried out by the sociologist Leo Srole and describe the cross-classification of 1660 adults in Manhattan, ages 20-59, obtained from a sample of midtown residents.
data(MANHATAN)
data(MANHATAN)
This data frame contains the following columns:
A factor with levels:
Well
;
Misy
;
Mosy
;
Imp
.
A factor with levels:
A
;
B
;
C
;
D
;
E
;
F
.
The absolute frequencies of which factor.
Goodman, L. A. (1987) New Methods for Analysing the Intrinsic Character of Qualitative Variables Using Cross-Classified Data. American Journal of Sociology 93, 529–583.
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.
The PerfMark
data frame has 31 rows and 46 columns.
The data set is the result of a survey of 47 beauty salons located at the city of Lavras, Brazil, consisting of two types of questions; the first identifies the profile of the owner manager (explanatory variable), the second are questions referring to the degree of professionalism with respect to planing, market and finances (response variable).
The data set is already cross-tabulated.
data(PerfMark)
data(PerfMark)
This data frame contains the following columns referring the absolute frequencies to each row variable:
Planning variables:
What is the dependence of the owner to function properly?.
What are your plans towards next year? only a dream.
What are your plans towards next year? vague goals.
Marketing variables:
Your business tries to systematically assess the customer satisfaction and use that as a basis for management decisions. Alternative 1.
Your business tries to systematically assess the customer satisfaction and use that as a basis for management decisions. Alternative 2.
Your business offers more than the usual services. Alternative 0.
Your business offers more than the usual services. Alternative 1.
Your business is focused to further customer loyalty. Alternative 0.
Your business is focused to further customer loyalty. Alternative 1.
Your business is focused to further customer loyalty. Alternative 2.
What is the proportion, among current customers, of those who are customers for more than 6 months. Alternative 2.
What is the proportion, among current customers, of those who are customers for more than 6 months. Alternative 3.
Your business offers more services than when it began. Alternative 2.
How is your business quality perceived as compared to the competition? Alternative 2.
How is your business quality perceived as compared to the competition? Alternative 3.
How is your business range of services perceived as compared to the competition? Alternative 1.
How is your business range of services perceived as compared to the competition? Alternative 2.
What is your business level of prices perceived as compared to the competition? Alternative 1.
What is your business level of prices perceived as compared to the competition? Alternative 2.
Your business location is perceived as appropriate to the target market. Alternative 3.
Your business uses formal media to advertise itself. Alternative 0.
Your business uses formal media to advertise itself. Alternative 1.
Your business uses formal media to advertise itself. Alternative 5.
Financial variables:
Your business clearly separates the owner bills from the business bills. Alternative 0.
Your business clearly separates the owner bills from the business bills. Alternative 4.
Your owners withdrawal are planned and controlled in advance. Alternative 0.
Your owners withdrawal are planned and controlled in advance. Alternative 1.
Your owners withdrawal are planned and controlled in advance. Alternative 4.
Your business pays for its purchases in installments. Alternative 1.
Your business pays for its purchases in installments. Alternative 4.
Your business knows today whether it will be able to pay its short-term bills of 60 days. Alternative 2.
Your business knows today whether it will be able to pay its short-term bills of 60 days. Alternative 4.
Your business uses short-term cash-flow analysis to plan for its short-term bills. Alternative 0.
Your business uses short-term cash-flow analysis to plan for its short-term bills. Alternative 1.
Your business has formal control of the monthly amount it makes from its services. Alternative 3.
Your business has formal control of the monthly amount it makes from its services. Alternative 4.
Your business uses either credit card, checkbook payment or loans, to finance its needs for working capital. Alternative 0.
Your business uses either credit card, checkbook payment or loans, to finance its needs for working capital. Alternative 4.
Your business uses specific credit to finance its needs for capital. Alternative 0.
The company demonstrates knowledge to properly assess the costs of products used in services and costs of renting and taxes. Alternative 1.
The company demonstrates knowledge to properly assess the costs of products used in services and costs of renting and taxes. Alternative 3.
Your business clearly identifies the need for working capital. Alternative 0.
Your business lays down the price of services in a systematic way. Alternative 1.
Your business lays down the price of services in a systematic way. Alternative 3.
The company calculates the interest on contracted loans. Alternative 0.
The company calculates the interest on contracted loans. Alternative 5.
Jelihovschi, E.G., Alves, R.R., and Correa, F.M. 2011. Interacting latent budget analysis and correspondence analysis to analyze beauty salon management data. Biometric Brazilian Journal, 29, 657-673.
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.
S3 methods for lba
objects.
plotcorr(x, ...) ## S3 method for class 'lba.1d' plotcorr(x, xlim = NULL, ylim = NULL, xlab = NULL, ylab = NULL, metrics = TRUE, radius = rep(0.5,2), col.points = NULL, height.points = NULL, labels.points = NULL, pch.points = NULL, pos.points = NULL, args.legend = NULL, height.budget = NULL, labels.budget = NULL, pch.budget = NULL, pos.budget = NULL, cex.budget = NULL, col.budget = NULL, with.ml = c("mix","lat"), ...) ## S3 method for class 'lba.2d' plotcorr(x, dim = c(1,2), #only K = 3 xlim = NULL, ylim = NULL, xlab = NULL, ylab = NULL, args.legend = NULL, col.points = NULL, labels.points = NULL, pch.points = NULL, pos.points = NULL, labels.budget = NULL, pch.budget = NULL, pos.budget = NULL, cex.budget = NULL, col.budget = NULL, with.ml = c("mix","lat"), ...) ## S3 method for class 'lba.3d' plotcorr(x, rgl.use = FALSE, dim = c(1,2,3), #only K >= 3 xlim = NULL, ylim = NULL, zlim = NULL, xlab = NULL, ylab = NULL, zlab = NULL, args.legend = NULL, #only rgl.use=FALSE col.points = NULL, labels.points = NULL, pch.points = NULL, pos.points = NULL, labels.budget = NULL, pch.budget = NULL, pos.budget = NULL, cex.budget = NULL, col.budget = NULL, with.ml = c("mix","lat"), ...)
plotcorr(x, ...) ## S3 method for class 'lba.1d' plotcorr(x, xlim = NULL, ylim = NULL, xlab = NULL, ylab = NULL, metrics = TRUE, radius = rep(0.5,2), col.points = NULL, height.points = NULL, labels.points = NULL, pch.points = NULL, pos.points = NULL, args.legend = NULL, height.budget = NULL, labels.budget = NULL, pch.budget = NULL, pos.budget = NULL, cex.budget = NULL, col.budget = NULL, with.ml = c("mix","lat"), ...) ## S3 method for class 'lba.2d' plotcorr(x, dim = c(1,2), #only K = 3 xlim = NULL, ylim = NULL, xlab = NULL, ylab = NULL, args.legend = NULL, col.points = NULL, labels.points = NULL, pch.points = NULL, pos.points = NULL, labels.budget = NULL, pch.budget = NULL, pos.budget = NULL, cex.budget = NULL, col.budget = NULL, with.ml = c("mix","lat"), ...) ## S3 method for class 'lba.3d' plotcorr(x, rgl.use = FALSE, dim = c(1,2,3), #only K >= 3 xlim = NULL, ylim = NULL, zlim = NULL, xlab = NULL, ylab = NULL, zlab = NULL, args.legend = NULL, #only rgl.use=FALSE col.points = NULL, labels.points = NULL, pch.points = NULL, pos.points = NULL, labels.budget = NULL, pch.budget = NULL, pos.budget = NULL, cex.budget = NULL, col.budget = NULL, with.ml = c("mix","lat"), ...)
x |
A object of |
dim |
The dimention to be plotted. The default is |
xlim |
The x limits (x1, x2) of the plot. |
ylim |
The y limits of the plot. |
zlim |
The z limits of the plot. |
xlab |
A label for the x axis, defaults to a description of "x". |
ylab |
A label for the y axis, defaults to a description of "y". |
zlab |
A label for the z axix, defaults to a description of "z". |
rgl.use |
A logical value. If |
metrics |
Logical. If |
radius |
A arbitrary number to choose the groups. The default is |
col.points |
The color points to be used, possibly vectors. The default is |
height.points |
Points label height in relation to the y-coordinate.The default is |
labels.points |
A character vector or expression specifying the _text_ to be written. The default is |
pch.points |
A symbols to use. O default is |
pos.points |
A position specifier for the text. If specified this overrides any "adj" value given. Values of "1", "2", "3" and "4", respectively indicate positions below, to the left of, above and to the right of the specified coordinates. |
args.legend |
List of additional arguments to be passed to |
pch.budget |
A symbols to use. O default is |
pos.budget |
A position specifier for the text. If specified this overrides any "adj" value given. Values of "1", "2", "3" and "4", respectively indicate positions below, to the left of, above and to the right of the specified coordinates. |
height.budget |
Budget label height in relation to the y-coordinate.The default is |
labels.budget |
A character vector or expression specifying the _text_ to be written. The default is |
cex.budget |
The size of text. The default is |
col.budget |
The color budget to be used, possibly vectors. The default is |
with.ml |
Vector of two character strings specifying the parameters of the plot. Set |
... |
Further graphical parameters. |
The plotcorr
suggested by Jelihovschi et all (2011), has a graphical display which uses the correspondence analysis graphics of the mixing parameters and latent components matrices. In this case, a graphic display is possible for K >= 2
.
The argument radius
was featured in order to help the user as he or she needs do decide which are the points belonging to a certain latent budget. Only the points to the right or left of LB1 and LB2 but always towards the center of the graphic (the zero of x axis) were taken in account, since those in opposite direction automatically belong to the closest latent budget. this argument only works for K = 2
. It's should be of size two.
The argument col.points
takes in account the argument radius
in order to color the groups which either belong or not to a certain budget, therefore, the size of the vector of this argument must be equal to the number of formed groups.
Enio G. Jelihovschi ([email protected])
Ivan Bezerra Allaman ([email protected])
de Leeuw, J., van der Heijden, P.G.M., and Verboon, P. 1990. "A latent time budget model". Statistica Neerlandica. 44, 1, 1-21.
Jelihovschi, E.G., Alves, R.R., and Correa, F.M. 2011. Interacting latent budget analysis and correspondence analysis to analyze beauty salon management data. Biometric Brazilian Journal, 29, 657-673.
van der Ark, A. L. 1999. Contributions to Latent Budget Analysis, a tool for the analysis of comositional data. Ph.D. Thesis University of Utrecht.
plot.default
, scatterplot3d
, plot3d
.
data('votB') K = 2 ex1 <- lba(parties ~ city, data=votB, K = 2) plotcorr(ex1) #It's very simple. with colors! plotcorr(ex1, col.points = 3:5, col.budget = c(5,3)) #Changing radius! plotcorr(ex1, radius = rep(0.7,2)) #Without metrics! plotcorr(ex1, metrics = FALSE) #Change legend options! plotcorr(ex1, args.legend = list(ncol=3)) #Change height points! plotcorr(ex1, height.points = rep(-0.1,6)) ## Not run: #K = 3 K = 3 ex2 <- lba(parties ~ city, data=votB, K = 3) plotcorr(ex2) #Change budget options plotcorr(ex2, pch.budget = 5, col.budget = 2, labels.budget = c('lba1','lba2','lba3')) #Change points options plotcorr(ex2, pch.points = 20, col.points = 4, labels.points = rownames(ex2$Aoi), args.legend = list(plot=FALSE)) #Coloring the groups plotcorr(ex2, col.points = c(1,2,2,3,3,2), col.budget = c(3,1,2), args.legend = list(ncol=3)) #K = 4 K = 4 data(postmater) new_post <- as.matrix(postmater[,-1]) row.names(new_post) <- postmater[,1] ex3 <- lba(new_post, K = K) plotcorr(ex3) #A bit didatic! plotcorr(ex3, args.legend = list(x = -2.5, y = 5.5, xpd=TRUE, ncol=5)) #Dynamic? Yes, you can! plotcorr(ex3, rgl.use = TRUE) ## End(Not run)
data('votB') K = 2 ex1 <- lba(parties ~ city, data=votB, K = 2) plotcorr(ex1) #It's very simple. with colors! plotcorr(ex1, col.points = 3:5, col.budget = c(5,3)) #Changing radius! plotcorr(ex1, radius = rep(0.7,2)) #Without metrics! plotcorr(ex1, metrics = FALSE) #Change legend options! plotcorr(ex1, args.legend = list(ncol=3)) #Change height points! plotcorr(ex1, height.points = rep(-0.1,6)) ## Not run: #K = 3 K = 3 ex2 <- lba(parties ~ city, data=votB, K = 3) plotcorr(ex2) #Change budget options plotcorr(ex2, pch.budget = 5, col.budget = 2, labels.budget = c('lba1','lba2','lba3')) #Change points options plotcorr(ex2, pch.points = 20, col.points = 4, labels.points = rownames(ex2$Aoi), args.legend = list(plot=FALSE)) #Coloring the groups plotcorr(ex2, col.points = c(1,2,2,3,3,2), col.budget = c(3,1,2), args.legend = list(ncol=3)) #K = 4 K = 4 data(postmater) new_post <- as.matrix(postmater[,-1]) row.names(new_post) <- postmater[,1] ex3 <- lba(new_post, K = K) plotcorr(ex3) #A bit didatic! plotcorr(ex3, args.legend = list(x = -2.5, y = 5.5, xpd=TRUE, ncol=5)) #Dynamic? Yes, you can! plotcorr(ex3, rgl.use = TRUE) ## End(Not run)
S3 methods for lba
objects.
## S3 method for class 'lba.1d' plotlba(x, height.line = NULL, xlab = NULL, ylab = NULL, ylim = NULL, args.legend = NULL, labels.points = NULL, col.points = par('col'), col.lines = par('col'), lty.lines = par('lty'), lwd.lines = par('lwd'), pch.budget = par('pch'), col.budget = par('fg'), lty.budget = par('lty'), lwd.budget = par('lwd'), colline.budget = NULL, with.ml = c("mix","lat"), ...) ## S3 method for class 'lba.2d' plotlba(x, axis.labels = NULL, labels.points = NULL, col.points = par('fg'), pch.budget = par('pch'), col.budget = par('fg'), lty.budget = par('lty'), lwd.budget = par('lwd'), colline.budget = par('fg'), args.legend = NULL, with.ml = c("mix","lat"), ...)
## S3 method for class 'lba.1d' plotlba(x, height.line = NULL, xlab = NULL, ylab = NULL, ylim = NULL, args.legend = NULL, labels.points = NULL, col.points = par('col'), col.lines = par('col'), lty.lines = par('lty'), lwd.lines = par('lwd'), pch.budget = par('pch'), col.budget = par('fg'), lty.budget = par('lty'), lwd.budget = par('lwd'), colline.budget = NULL, with.ml = c("mix","lat"), ...) ## S3 method for class 'lba.2d' plotlba(x, axis.labels = NULL, labels.points = NULL, col.points = par('fg'), pch.budget = par('pch'), col.budget = par('fg'), lty.budget = par('lty'), lwd.budget = par('lwd'), colline.budget = par('fg'), args.legend = NULL, with.ml = c("mix","lat"), ...)
x |
A object of |
height.line |
Is a vector with the lines height when |
xlab |
A title for the x axis. |
ylab |
A title for the y axis. |
ylim |
The y limits of the plot. |
args.legend |
List of additional arguments to be passed to |
axis.labels |
Labels for the three axes in the order left, right, bottom. Defaults to the column names. |
labels.points |
A character vector or expression specifying the text to be written. The default is |
col.points |
A |
col.lines |
A |
lty.lines |
A |
lwd.lines |
A |
pch.budget |
A |
col.budget |
A |
lty.budget |
A |
lwd.budget |
A |
colline.budget |
The colors for line budget. The default is |
with.ml |
What's parameters do you like to plot? The default is mixing parameters ( |
... |
Other graphical parameters may also be passed as arguments to these functions. |
The plotlba
function, was suggested at de Leeuw et all (1990) and at van der Ark (1999) thesis. Those types of plots have only graphical views for K = 2
and K = 3
. When K = 2
, either the latent budgets or the mixing parameters are displayed on a (one dimensional) line segment. When K = 3
, either the latent budgets or the mixing parameters are displayed in a equilateral triangle using a barycentric coordinate system where the budgets are represented by the vertices and the plot is made with help of triax.plot
and triax.points
function of plotrix package.
Enio G. Jelihovschi ([email protected])
Ivan Bezerra Allaman ([email protected])
de Leeuw, J., van der Heijden, P.G.M., and Verboon, P. 1990. "A latent time budget model". Statistica Neerlandica. 44, 1, 1-21.
van der Ark, A. L. 1999. Contributions to Latent Budget Analysis, a tool for the analysis of comositional data. Ph.D. Thesis University of Utrecht.
data('votB') #K = 2 ex1 <- lba(parties ~ city, data=votB, K = 2) plotlba(ex1) #It's very simple. With colors! plotlba(ex1, col.points = 1:6, col.lines = 1:6) #Add title in plot! plotlba(ex1, main='Mixing parameters') #Change budget proportion! plotlba(ex1, pch.budget = 23, col.budget = 9, colline.budget = 8, lwd.budget = 2, lty.budget = 2) #A little more! plotlba(ex1, xlab = 'Lb2 -> Lb1', height.line = rep(0.5,6), lty.lines = 2, args.legend = list(ncol=3)) ## Not run: #K = 3 data(MANHATAN) tbm <- xtabs(value ~ socecon+health, MANHATAN) ex2 <- lba(tbm, K = 3) plotlba(ex2) #A little more! plotlba(ex2, labels.points = rownames(tbm), col.points = 2:7, args.legend = list(plot=F)) plotlba(ex2, col.points = 3:8, col.budget = 2, pch.budget = 20, lty.budget = 2, lwd.budget = 3, colline.budget = 3, axis.labels = c('Lba1','Lba2','Lba3')) ## End(Not run)
data('votB') #K = 2 ex1 <- lba(parties ~ city, data=votB, K = 2) plotlba(ex1) #It's very simple. With colors! plotlba(ex1, col.points = 1:6, col.lines = 1:6) #Add title in plot! plotlba(ex1, main='Mixing parameters') #Change budget proportion! plotlba(ex1, pch.budget = 23, col.budget = 9, colline.budget = 8, lwd.budget = 2, lty.budget = 2) #A little more! plotlba(ex1, xlab = 'Lb2 -> Lb1', height.line = rep(0.5,6), lty.lines = 2, args.legend = list(ncol=3)) ## Not run: #K = 3 data(MANHATAN) tbm <- xtabs(value ~ socecon+health, MANHATAN) ex2 <- lba(tbm, K = 3) plotlba(ex2) #A little more! plotlba(ex2, labels.points = rownames(tbm), col.points = 2:7, args.legend = list(plot=F)) plotlba(ex2, col.points = 3:8, col.budget = 2, pch.budget = 20, lty.budget = 2, lwd.budget = 3, colline.budget = 3, axis.labels = c('Lba1','Lba2','Lba3')) ## End(Not run)
The postmater
data frame has 13 rows and 8 columns. The raw data refers to a political and social survey across Europe that is conducted twice a year.
data(postmater)
data(postmater)
This data frame contains the following columns:
A factor with levels:
F
France;
B
Belgium;
NL
Netherlands;
D
Germany;
I
Italy;
L
Luxembourg.
DK
Denmark.
IRL
Ireland.
GB
Great Britain.
NIRL
Northern Ireland.
GR
Greece.
E
Spain.
P
Portugal.
The absolute frequencies of materialist factor in the respect country. The degree of ranking of this index is ++.
The absolute frequencies of materialist factor in the respect country. The degree of ranking of this index is +.
The absolute frequencies of materialist factor in the respect country. The degree of ranking of this index is below of the "m.".
The absolute frequencies of materialist/post-materialist factor in the respect country. The degree of ranking of this index is below of the "m".
The absolute frequencies of post-materialist factor in the respect country. The degree of ranking of this index is below of the "m_pm".
The absolute frequencies of post-materialist factor in the respect country. The degree of ranking of this index is below of the "pm".
The absolute frequencies of post-materialist factor in the respect country. The degree of ranking of this index is below of the "pm.".
Reif, K., and Melich, A. (1990). Euro-Barometer 29: Environmental problems and Cancer, March-April 1988. Ann Arbor: Inter-university Consortium for Political and Social Research.
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.
The pregnancy
matrix has 16 rows and 5 columns. The raw data refers to California pregnancy-related deaths from 2002-2005.
data(pregnancy)
data(pregnancy)
This matrix contains the following columns:
Preeclampsia/eclampsia
Obstetric hemorrhage
Cardiovascular diseases
Deep vein thrombosis - pulmonary embolism
Amniotic fluid embolism
The rows refers to:
Hispanic,foreign-born
Hispanic, us-born
White, non-hispanic
Black, non-hispanic
Maternal age
Maternal age
Maternal age
Parity
Parity
Parity
Maternal age
Maternal age
Maternal age
Gestational age at delivery
Gestational age at delivery
Gestational age at delivery
Main, E. K.; et al. Pregnancy-Related Mortality in California: Causes, Characteristics, and Improvement Opportunities. OBSTETRICS and GYNECOLOGY. 125, 938–947.
Main, E. K.; et al. Pregnancy-Related Mortality in California: Causes, Characteristics, and Improvement Opportunities. OBSTETRICS and GYNECOLOGY. 125, 938–947.
Returns (and prints) a summary list for goodnessfit objects.
## S3 method for class 'goodnessfit.lba.ls' print(x, digits=3L, ...) ## S3 method for class 'goodnessfit.lba.ls.fe' print(x, digits=3L, ...) ## S3 method for class 'goodnessfit.lba.ls.logit' print(x, digits=3L, ...) ## S3 method for class 'goodnessfit.lba.mle' print(x, digits=3L, ...) ## S3 method for class 'goodnessfit.lba.mle.fe' print(x, digits=3L, ...) ## S3 method for class 'goodnessfit.lba.mle.logit' print(x, digits=3L, ...)
## S3 method for class 'goodnessfit.lba.ls' print(x, digits=3L, ...) ## S3 method for class 'goodnessfit.lba.ls.fe' print(x, digits=3L, ...) ## S3 method for class 'goodnessfit.lba.ls.logit' print(x, digits=3L, ...) ## S3 method for class 'goodnessfit.lba.mle' print(x, digits=3L, ...) ## S3 method for class 'goodnessfit.lba.mle.fe' print(x, digits=3L, ...) ## S3 method for class 'goodnessfit.lba.mle.logit' print(x, digits=3L, ...)
x |
A given object of the class |
digits |
A non-null value for digits specifies the minimum number of significant digits to be printed in values. The default is 3. |
... |
Further arguments (require by generic). |
Enio G. Jelihovschi ([email protected])
Ivan Bezerra Allaman ([email protected])
summary.goodnessfit.lba.ls
, summary.goodnessfit.lba.mle
data('votB') # Using LS method (default) without constraint # K = 2 ex1 <- lba(city ~ parties, votB, K = 2) exm <- goodnessfit(ex1) exm
data('votB') # Using LS method (default) without constraint # K = 2 ex1 <- lba(city ~ parties, votB, K = 2) exm <- goodnessfit(ex1) exm
lba
objects.
Returns (and prints) a summary list for objects of class lba.ls
, lba.ls.fe
, lba.ls.logit
, lba.mle
, lba.mle.fe
, and lba.mle.logit
.
## S3 method for class 'lba.ls' print(x, digits = 3L, ...) ## S3 method for class 'lba.ls.fe' print(x, digits = 3L, ...) ## S3 method for class 'lba.ls.logit' print(x, digits = 3L, ...) ## S3 method for class 'lba.mle' print(x, digits = 3L, ...) ## S3 method for class 'lba.mle.fe' print(x, digits = 3L, ...) ## S3 method for class 'lba.mle.logit' print(x, digits = 3L, ...)
## S3 method for class 'lba.ls' print(x, digits = 3L, ...) ## S3 method for class 'lba.ls.fe' print(x, digits = 3L, ...) ## S3 method for class 'lba.ls.logit' print(x, digits = 3L, ...) ## S3 method for class 'lba.mle' print(x, digits = 3L, ...) ## S3 method for class 'lba.mle.fe' print(x, digits = 3L, ...) ## S3 method for class 'lba.mle.logit' print(x, digits = 3L, ...)
x |
A given object of the class |
digits |
Number of decimal digits in the results. The default is 3. |
... |
Further arguments (require by generic). |
Enio G. Jelihovschi ([email protected])
Ivan Bezerra Allaman ([email protected])
data('votB') # Using LS method (default) without constraint # K = 2 ex1 <- lba(city ~ parties, votB, K = 2) ex1
data('votB') # Using LS method (default) without constraint # K = 2 ex1 <- lba(city ~ parties, votB, K = 2) ex1
Returns (and prints) a summary list for goodnessfit objects.
## S3 method for class 'goodnessfit.lba.ls' summary(object, digits = 2L, ...) ## S3 method for class 'goodnessfit.lba.ls.fe' summary(object, digits = 2L, ...) ## S3 method for class 'goodnessfit.lba.ls.logit' summary(object, digits = 2L, ...) ## S3 method for class 'goodnessfit.lba.mle' summary(object, digits = 2L, ...) ## S3 method for class 'goodnessfit.lba.mle.fe' summary(object, digits = 2L, ...) ## S3 method for class 'goodnessfit.lba.mle.logit' summary(object, digits = 2L, ...)
## S3 method for class 'goodnessfit.lba.ls' summary(object, digits = 2L, ...) ## S3 method for class 'goodnessfit.lba.ls.fe' summary(object, digits = 2L, ...) ## S3 method for class 'goodnessfit.lba.ls.logit' summary(object, digits = 2L, ...) ## S3 method for class 'goodnessfit.lba.mle' summary(object, digits = 2L, ...) ## S3 method for class 'goodnessfit.lba.mle.fe' summary(object, digits = 2L, ...) ## S3 method for class 'goodnessfit.lba.mle.logit' summary(object, digits = 2L, ...)
object |
A given object of the class |
digits |
Number of decimal digits in the results. The default is 2. |
... |
Further arguments (require by generic). |
Enio G. Jelihovschi ([email protected])
Ivan Bezerra Allaman ([email protected])
data('votB') # Using LS method (default) without constraint # K = 2 ex1 <- lba(city ~ parties, votB, K = 2) exm <- goodnessfit(ex1) summary(exm)
data('votB') # Using LS method (default) without constraint # K = 2 ex1 <- lba(city ~ parties, votB, K = 2) exm <- goodnessfit(ex1) summary(exm)
lba
objects.
Returns (and prints) a summary list for objects of class lba
, lba.ls.fe
, lba.ls.logit
, lba.mle
, lba.mle.fe
, and lba.mle.logit
.
## S3 method for class 'lba.ls' summary(object, digits = 2L, ...) ## S3 method for class 'lba.ls.fe' summary(object, digits = 2L, ...) ## S3 method for class 'lba.ls.logit' summary(object, digits = 2L, ...) ## S3 method for class 'lba.mle' summary(object, digits = 2L, ...) ## S3 method for class 'lba.mle.fe' summary(object, digits = 2L, ...) ## S3 method for class 'lba.mle.logit' summary(object, digits = 2L, ...)
## S3 method for class 'lba.ls' summary(object, digits = 2L, ...) ## S3 method for class 'lba.ls.fe' summary(object, digits = 2L, ...) ## S3 method for class 'lba.ls.logit' summary(object, digits = 2L, ...) ## S3 method for class 'lba.mle' summary(object, digits = 2L, ...) ## S3 method for class 'lba.mle.fe' summary(object, digits = 2L, ...) ## S3 method for class 'lba.mle.logit' summary(object, digits = 2L, ...)
object |
A given object of the class |
digits |
Number of decimal digits in the results.The default is 2. |
... |
Further arguments (require by generic). |
Enio G. Jelihovschi ([email protected])
Ivan Bezerra Allaman ([email protected])
data('votB') # Using LS method (default) without constraint # K = 2 ex1 <- lba(city ~ parties, votB, K = 2) summary(ex1)
data('votB') # Using LS method (default) without constraint # K = 2 ex1 <- lba(city ~ parties, votB, K = 2) summary(ex1)
The votB
data frame has 8971 rows and 2 columns.
The raw data refers to the type of the city and the political party which each
participant voted for in the 1986 general elections in the Netherlands.
data(votB)
data(votB)
This data frame contains the following columns:
A factor with levels:
co
Commuter;
lx
Large city;
mc
Middle large city;
ri
Rural industrialised;
ru
Rural;
sc
Small city.
A factor with levels:
cda
Christian democrats;
d66
Democrats;
left
Other left-wing parties;
Pvda
Labor party;
right
Other right-wing parties;
vvd
Liberals.
Statistics Netherlands (1987). Statistiek der verkiezingen 1986. Tweede Kamer der Staten-Generaal 21 mei 1996. [Statistics of the elections of the Lower House, May 21-th 1996]. The Hague: Staatsuitgeverij.
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.