269 lba : An R Package for Latent Budget Analysis by

Abstract The latent budget model is a mixture model for compositional data sets in which the entries, a contingency table, may be either realizations from a product multinomial distribution or distribution free. Based on this model, the latent budget analysis considers the interactions of two variables; the explanatory (row) and the response (column) variables. The package lba uses expectation-maximization and active constraints method (ACM) to carry out, respectively, the maximum likelihood and the least squares estimation of the model parameters. It contains three main functions, lba which performs the analysis, goodnessfit for model selection and goodness of fit and the plotting functions plotcorr and plotlba used as a help in the interpretation of the results.


Introduction
The idea of latent budget was first proposed by Goodman (1974) in which he wanted to show a method to analyse the relationship between a set of qualitative variables, when some of them are manifested variables and other are non observable or latent variables.These ideas were later elaborated by Clogg (1981) by interpreting a simple latent class model in an asymmetric way.Independently, de Leeuw and van der Heijden (1988) introduced the model and named it latent budget analysis because they used it to analyse time-budget data.The model was also introduced independently in geology by Renner (1988), where it is known as the endmember model.
LBA is an analysis method for compositional data which is basically an I × J matrix where the row variable with I categories is called the explanatory variable and the column variable with J categories is called the response variable.In compositional data each row is considered a J dimensional vector of conditional probabilities so that, for every row, they add up to one.LBA is used to understand the relationship between those two variables.
LBA allows us to find out which categories of the response variables 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.It is done by 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 reduces the dimensionality of the original problem, thus making it easier to understand its hidden relations.
Examples of latent budget models in sociological research, political sciences and other areas where categorical variables are used can be found in Van der Ark (1999a).Generalizations of the LBA method may be found in Siciliano and Heijden (1994), Siciliano and Mooijaart (2001) and Aria (2008).However, we found few articles in our literature search that used LBA in their data analyses.Larrosa (2005) shows how to use LBA in applications to economics.Tambrea and Siciliano (1999) proposed an LBA approach for three-way tables in a business field.We can also cite Aquilia et al. (2015) in geology, Ros-Freixedes and Estany (2014) in biology, and Aria et al. (2003) in food engineering.
In our point of view, the reason why the use of LBA is not more widespread is due to the lack of available software.The software "A freeware computer program to perform latent budget analysis" written by L. Andries van der Ark (Van der Ark, 1999b) in Borland Pascal 7.0 only runs under MS-DOS.Unfortunately, it is no longer available at http://come.to/lba/software.The only software we could find that performs LBA analysis is CoDaPack http://ima.udg.edu/codapack/, which until recently only ran in the Windows operational system.Therefore, because of the importance LBA has in categorical data analysis, the authors decided to write the lba package.This is the first package for this type of analysis in R. The package is available from both the Comprehensive R Archive Network at http://cran.r-project.org/web/packages/lba/index.html and the lba project web site at https://github.com/ivanalaman/lba.

Latent budget model
LBM is a mixture model for compositional data.A row of compositional data is called a composition or a budget and its elements are the components.We will follow the notation of Van der Ark (1999a).He says: "by performing LBA we approximate I observed budgets, which may represent persons, groups or objects by a small number of latent budgets, consisting of typical characteristics of the sample."See The R Journal Vol.10/1, July 2018 ISSN 2073-4859 also de Leeuw et al. (1990) and van der Heijden et al. (1992).

Terminology and model definition
The original contingency table is N(I, J).Let us also define: • row total: n i+ = ∑ j n ij .
The compositional data matrix P is formed by dividing the raw data by their corresponding row total.Let us call the observed components p i|j (i = 1, . . ., I; j = 1, . . ., J) then, p i|j = n ij n i+ , p i+ = n i+ n and p +j = n +j n .Each row vector p i of P is called an observed budget and is approximated by the expected budget π i which is a mixture of K, (K ≤ min(I, J)) latent budgets.
The row vectors π i , (i = 1, . . ., I) form the expected matrix π which has a lower rank and, in LBM, approximates P.
The latent budgets are represented by β k , (k = 1, . . ., K) and the model is written as where α k|i are the mixing parameters.
The elements of π are π j|i and are called expected components.The elements of β k , β j|k are called latent components.In scalar notation, π j|i = ∑ K k=1 α k|i β j|k , and in matrix notation Π = AB where Π is an I × J matrix whose rows are the expected budgets.A is an I × K matrix of mixing parameters and B is a J × K matrix whose columns are the latent budgets.LBM(K) is then the latent budget model with K latent budgets.Similar to the observed components, the parameters of LBM are subject to the sum constraints β j|k = 1 and the non-negativity constraints 0 ≤ π j|i , α k|i , β j|k ≤ 1.In this way, all parameters are proportions that further facilitate the interpretation of the model.
Quoting Van der Ark (1999a) The latent budgets can be characterized by being compared to the latent budgets of LBM(1).LBM(1) is the independence model with α 1|i = 1 and β j|1 = p +j , in this case π i = β 1 .Hence, if latent component β j|k ≥ p +j , then β k is characterized by the j-th category.On the other hand, if β j|k ≤ p +j , then the j-th category is of lesser importance.The relative importance of each latent budget, in terms of how much of the expected data they account for, is expressed by the budget proportions π k = ∑ i p i+ α k|i .
The π k parameter also denotes the probability of latent budget k when there is no information about the level of the row variable.To understand how the expected budgets are constructed to form the latent budgets, we must compare the mixing parameters to π k .If α k|i ≥ π k then the expected budget π is characterized more than average by latent budget β k , otherwise, if α k|i ≤ π k then the expected budget π is characterized less than average by latent budget β k .In practice, the mixture model interpretation is easier to carry out when we first characterize the latent budgets and then interpret the expected budgets in terms of them.
Compositional data that follows the product multinomial sampling scheme may be estimated by the maximum likelihood estimation method (MLE) which is estimated by using the EM algorithm (Dempster et al., 1977).On the other hand, if the data cannot be assumed to follow that distribution, using MLE is not recommended.Following Van der Ark (1999a) we opted to estimate by using weighted least squares (WLS) estimators since it is a distribution free method, that is, one which does not assume any probability configuration on the data, see Mooijaart et al. (1999).

Unconstrained parameter estimation: maximum likelihood estimator (MLE)
In de Leeuw et al. (1990) they describe the MLE for compositional data under a product-multinomial distribution.The log likelihood is: (1) The R Journal Vol.10/1, July 2018 ISSN 2073-4859 In this case, π j|i is dependent on a latent variable with K categories, where the observations on that latent variable are missing.Therefore the complete data loglikelihood function is: The π ijk parameters are the unknown joint probabilities of the two manifest variables and the latent variable where n ijk are the unknown joint frequencies of the three variables where n ijk = π ijk n ++ .In that paper, de Leeuw et al. (1990) use an EM-algorithm to maximize the complete data loglikelihood.
The EM algorithm proceeds iteratively.Beginning with arbitrary initial values of α k|i and β j|k , which may be set either by the user or randomly generated by the package function, and labelling them α0 k|i and β0 j|k ∀i, j, k to meet the sum and the no-negativity constraints.In the expectation (E) step, calculate π0 ijk from the initial estimates and find the estimator for n ijk which is: In the maximization (M) step, given πnew ijk and nnew ijk , the complete data loglikelihood is maximized.In de Leeuw et al. (1990) they show that this yields the following estimates for the next iteration: and (5)

Unconstrained parameter estimation: weighted least squares (WLS)
The WLS function to be minimized is: The weights v i w j may be chosen freely.If they are chosen to equal one, the WLS becomes the ordinary least squares (OLS).
The lba package follows the algorithm completely described in Van der Ark (1999a) and Mooijaart et al. (1999) called the active constraints method (ACM).The method is a minimization with constraints.The equality constraints are the row sums of matrix A and column sums of matrix B, and the inequality constraints are the values of all elements of A and which must be greater than zero.

Identifiability: K = 2
In general, the LBM is not identifiable, meaning that there could be various sets of parameters yielding the same goodness of fit (van der Ark et al., 1999).In fact, as de Leeuw et al. (1990) show, Π = AB = AT −1 TB = A * B * where A * = AT −1 and B * = TB .
T is a matrix of order K × K with elements τ cd .To ensure that the rows of A * and the columns of B * add up to one, de Leeuw et al. (1990) proved that T is subject to the constraints that all elements of T must be nonnegative and We follow van der Ark et al. (1999) in which he shows that T can be chosen such that the latent budget solution is optimal in a specific sense.
The lba package follows the solutions proposed by de Leeuw et al. (1990) for LBM(2), as described in Van der Ark (1999a) Chapter 2, when discussing the geometry of LBM(2).
In LBM(2), the unidentified latent budgets β 1 and β 2 can be viewed as two vectors The R Journal Vol.10/1, July 2018 ISSN 2073-4859 in a J-dimensional space.The heads of any two vectors can be connected by a line segment, denoted by V, which is a subset of a line S.The expected budgets π 1 , . . ., π I are J-dimensional vectors and convex combinations of β 1 and β 2 .Therefore, the heads of π 1 , . . ., π I lie on V, and the relative distance from π 1 , . . ., π I to β 1 and β 2 is expressed by the mixing parameters.The unidentified latent budgets β 1 and β 2 , collected in B, can be transformed into B * .
The region of budgets is denoted by U. The vectors that bound U are called outer extreme budgets, and have one component equal to zero.LBM(2) always has two outer extreme budgets.Not every b ∈ U is a feasible latent budget.A latent budget cannot lie between two expected budgets, because this would result in negative mixing parameters.Hence a latent budget cannot lie within the space spanned by the expected budgets that take the most extreme position on S.This space is denoted by W. The most extreme expected budgets are called inner extreme budgets.
The matrices T to get the transformations into B * are found in both the outer extreme solution and the inner extreme solution.They are used to get the respective A * matrices.
In the outer extreme solution the latent budgets are as different as possible, simplifying their interpretation in most cases.In the inner extreme solution, the latent budgets are as similar as possible.At the same time, the mixing parameters will be as different as possible.

Identifiability: K ≥ 3
Van der Ark (1999a) uses the following criteria to identify the solutions: minimize ∑ Q q=1 δ χ 2 q for an identified inner extreme solution and maximize 1/ ∑ Q q=1 δ χ 2 q for an identified outer extreme solution.Where Q = ( n k ), i.e., the number of distances among the K latent budgets, and In order to find those minimal solutions, the lba package uses the constrOptim.nlfunction from the alabama package (Varadhan, 2015).In this case the "BFGS" algorithm is used .

Constrained parameter estimation
Parameters in LBM may be subject to optional constraints, which can be imposed by a researcher, either to test specific hypotheses about the model to facilitate its interpretation, or to build complex models.
There are three different types of optional constraints, namely fixed value constraints, equality constraints, and multinomial logit constraints.
Fixed value constraints have the form α k|i = c or β j|k = c , where 0 ≤ c ≤ 1 and 0 ≤ c ≤ 1 are constants.

Equality constraints have the form α k
when equalities are placed on the mixing parameters and when equalities are placed on the latent components.
The multinomial logit constraints were introduced in LBA by van der Heijden et al. (1992), and have the following form: , for the mixing parameters, where γ sk are the multinomial logit parameters; and , for the latent components, where ψ tk are the multinomial logit parameters.For a detailed discussion see Van der Ark (1999a) Chapter 3.
The S variables that contain the additional information about the mixing parameters, are called row covariates and the I × S matrix X is called the row design matrix.Similarly, the T variables that contain the additional information about the latent components, are called column covariates and the The R Journal Vol.10/1, July 2018 ISSN 2073-4859 J × T matrix Y is called the column design matrix.Both the sum constraints and the non-negativity constraints are satisfied by the multinomial logit constraints.
The degrees of freedom, according to de Leeuw et al. (1990), is the number of independent cells minus the number of independent parameters, For compositional data the number of independent cells is always I(J − 1) due to the sum constraints on the observed budgets.For the unconstrained LBM(K), we have I(K − 1) free mixing parameters, and K(J − 1) free latent components.However, the model is not identifiable and K(K − 1) parameters should be fixed.Hence the number of degrees of freedom is The lba package only runs the identifiability function when there are no optional constraints in the model.This is due to the fact that it is not possible to maintain the constraints while running that function.Therefore users who use optional constraints should use K(K − 1) fixed parameters or an adequate number of other constraints in order to attain identifiability.
The maximum likelihood estimation is adjusted for fixed value constraint according to van der Heijden et al. (1992).
Let α l|r = c, then the new adjusted value of Equation 4for the free mixing parameters is: and, if β s|r = c , then the new adjusted value of Equation 5for the free latent components is: .
Optional equality constraints for parameter estimates obtained with the EM algorithm are described in Mooijaart and van der Heijden (1992); see also van der Heijden et al. (1992).For the mixing parameters, if α k|i = α k |i the new adjusted values of Equation 4 are: and, for β j|k = β j |k , the new adjusted values of Equation 5 are: .
The remaining parameters should be updated by using quations 4 and 5.
In van der Heijden et al. (1992) they warn that the estimation of optional equality constraints (in combination with fixed value constraints) by the EM-algorithm is not always correct.The lba package takes it into account automatically and uses the alabama package to estimate the parameters when necessary.
The estimation of the parameters under multinomial logit constraints is described in van der Heijden et al. (1992).The complete data log likelihood function can be split into two parts where one depends only on row covariates and the other only on the column covariates; therefore, the E-step of the EM algorithm is the same as in the unconstrained LBM.The M-step is implemented by making use of the optim function and the alabama package.
Depending on the values of the matrices X and Y, the exponential values of the row and column covariates might become infinity.They are replaced by 1e6.Also, whenever the values of the row or column covariates are not supplied, lba creates random values from the standard normal distribution.

Note:
• Depending on the starting parameters, all algorithms cited above may only locate a local, rather than global, maximum or minimum.This becomes more and more of a problem as K, the number of latent budgets, increases.It is therefore highly advisable to run lba a few times until you are relatively certain that you have located the global maximum log-likelihood, the global minimum least squares, or the identification minimization.
• Some times it a label switching may occur.Usually the interpretation remains the same but the label of the budgets might not be the same.The lba package does try to minimize those occurrences, nevertheless they still may occur.

Model selection and goodness of fit criteria
Latent budget analysis has a great variety of tools available for assessing model fit and determining an appropriate number of latent budgets K for a given data set.In some applications, the number of latent budgets will be selected for primarily theoretical reasons.In other cases, however, the analysis may be of a more exploratory nature, with the objective being to locate the best fitting or most parsimonious model.The researcher may then begin by fitting an independence LBM(1), and then iteratively increasing the number of latent budgets one by one until a suitable fit has been achieved.
Adding an additional budget to a latent budget model will increase the fit of the model, but at the risk of fitting too much noise, and at the expense of estimating further I + J model parameters.Parsimony criteria seeks to strike a balance between over and under-fitting the model to the data by penalizing the log-likelihood for a function of the number of parameters being estimated.Usually, the researcher must take into account that parsimony is the best help in order to achieve a good interpretation of the model, that means a close resemblance between the observed and expected data, with as few parameters as possible.See de Leeuw and van der Heijden (1988), de Leeuw et al. (1990), and Van der Ark (1999a).
The most used criteria can be found in the Table 1.

Statistics Formula
Likelihood ratio statistic RSS and wRSS must be compared to the RSS's of other models in order to be meaningful.
The lba package calculates a great variety of goodness of fit statistics (GFS).Some can only be used with the data following the product multinomial distribution; others, on the other hand, may be used with distribution free data.A few have an asymptotic chi-square distribution, called exact GFS, but most have an unknown distribution.

Computation time as a function of the data matrix dimension and the number of latent budgets
Every numerical method performing an estimation of many parameters which depends on a optimization algorithm is going to be computationally time consuming.The lba package in particular uses a maximization with constraints in order to identify the parameters being estimated.The alabama package is used in this case and furthermore the restrictions, which are row sums of matrix A and column sums of matrix B must be one, is programmed in alabama in a very complex way.All those conditions tend to make alabama somewhat computationally time consuming, nevertheless, in our experience, those times are not too long.Figure 1 shows that the most important time consuming parameter is the number of latent budgets, K, the size of the data matrix is not very significant in increasing computation time while keeping K constant.

The lba package
The main function of package lba is lba.This function input may be an object of class "formula", "matrix" or "table".The lba function can be called by: The lba(obj, ...) If the object is from class "formula", the method lba.formula will be called: values equal one, then we get the ordinary least squares.The other available method is the maximum likelihood estimator.
The arguments A and B are used whenever the user wants to set the initial values of the mixing parameters or latent components respectively.If the user has no initial values to set, those matrices are randomly set by using a Dirichlet distribution.For matrix A the distribution parameters are I and alphavec where I is the row number of the compositional data matrix and alphavec is randomly generated from a uniform distribution with parameter K (number of latent budgets) as for B the parameters are K and alphavec which is randomly generated from a uniform distribution with parameter J where J is the column number of the compositional data matrix.
The arguments cA,cB must be used whenever the estimation process is done with constraints on the parameters α or β respectively.For fixed value constraints, they must give values between zero and one.For equality constraints, they must be integers greater or equal to two where the parameters with the same value will be considered equal.
Use help(lba) for the remaining parameters.
The lba package can produce plots of the mixing parameters and latent components matrices.For K = 3, lba performs two different kinds of plots.One is the triangular (or ternary) coordinate system, suggested by Van der Ark (1999a) and de Leeuw et al. (1990), the other is the correspondence analysis (CA) plot suggested by Jelihovschi et al. (2011), which can also be made for any K ≥ 3. It is important to note that the CA plots are applied to the indentified mixing parameters and identified latent components matrices; in lba they are respectively the matrices Aoi and Boi.For K = 2, lba does, as suggested by Van der Ark (1999a) page 41, also use the correspondence analysis result.The function which creates the correspondence analysis plot is called plotcorr, the other one is called plotlba.
It should be noted that when plotting the latent components using the triangular coordinate system, lba uses the rescaled latent components matrix whose values are: β k|j = β j|k π k p +j .Note that in this case the row sums equal one, not column sums as in the latent components matrix.
The functions plotlba and plotcorr use the generic functions plot, axis, text, points, segments and legend for K = 2.For K = 3, the function plotlba uses the functions triax.plot,triax.pointsand thigmophobe.labelsfrom package plotrix and also segments and legend.The function plotcorr uses the generic functions for K = 2. Whenever K ≥ 4, only the function plotcorr is used.In this case the function scatterplot3d from package scatterplot3d is internally called.Finally, if the argument rgl = TRUE is used, then the function plot3d from package rgl will be called.
The goodness of fit results can be obtained by making use of the function goodnessfit(obj,...) where obj is an object of class "lba".• parity,

Examples
• gestational age at delivery, • maternal race and country of birth, • body mass index -BMI.
which will be the rows or budgets of the data matrices.Since all rows of the BMI matrix are independent, the product multinomial model can be used and the maximum likelihood estimation (MLE) method applies.We will also use K = 2 because the number of rows is 3 (and so, K = 3 is the saturated model).We used the function set.seedso that the user who wishes to replicate the analysis may get the same results as the ones shown below.

> goodnessfit(bmilba)
Likelihood ratio statistic: K budget Baseline G2 value 1.809 2.95e+01 P-value 0.613 2.63e-04 The goodness of fit result shows that the likelihood ratio statistic (G2) used to test the model gave a p-value of 0.613 and thus accepting the model with K = 2.The summary of both lba and goodnessfit functions gives complete results.The only other possible model is the independence model, or baseline model, which has a p-value of 0.000263 and so, it is rejected.The interpretation of the model is easily done by using the correspondence analysis plot, which is created using the function plotcorr.
−1.0 0.0 1.0 2.0 q q LB1 LB2 q q q 1 2 3 0.5 un.0.5 un.The plot has just one dimension, so that the points are spread only along the horizontal axis; see documentation of function plotcorr.Unlike the Example 1, the matrix rows are not independent since the same women are counted in each one of the row variables.Therefore the MLE method does not apply here and we use the least squares method in order to estimate the model parameters.The functions to call are:  The weighted residual sum of squares between the observed components and the expected components (wRSS) were used as a goodness of fit statistic, and the independence model, LBM(1) as a baseline model.
We followed Van der Ark (1999a) for the following guidelines in order to make a decision on the number of latent budgets to be used: • The proportion of lack of fit with respect to the baseline model should be the largest one.
The R Journal Vol.10/1, July 2018 ISSN 2073-4859 • the improvement of adding an extra latent budget should be large enough to justify the increased effort of interpreting the extra set of parameter estimates.In order to achieve this we use the criterion that the average improvement of fit per degree of freedom as shown in the summary(goodnessfit) times the number of the difference of degrees of freedom between two values of K being calculated.
• The results should be interpretable.
Both the models with K = 2 and K = 3 improve the previous model.We decide for K = 3 and try to interpret it.
Dim 2 (47.3%)The interpretation of the latent budgets goes as follows: LB2 is explained by pre-eclampsia/eclampsia, which is a condition that occurs only in pregnant women, which is characterized by high blood pressure.LB1 has two conditions: AFE, which is a pregnancy condition; and DVTPE, which is a more general condition, and LB3 is explained by CVD.Unlike the first example, it does not put together CVD and DVTPE (Figure 3).
The mixing parameters connected to LB2 are gestational age at delivery of 32 to 36 weeks and maternal age older than 40 years.Pre.E may occur any time after the twentieth week.The LB1 is connected to women with more than 5 children, and age from 30 to 40 years.LB3 is connected to younger women with 2 to 4 children and early delivery (Figure 3).

Example 3; maternal race and country of birth
In this example we consider as explanatory variables, maternal age and country of birth in connection to pregnancy related death.The resulting data matrix is in Table 5.This matrix has independent rows so that the product multinomial model and the MLE method are used to estimate the mixing parameters and latent components.
−1.5 −0.5 0.0 0.5 1.0 1.5 Pre.E  show that the LB2 is composed of CVD and DVTPE which are the more general conditions, and LB1 is composed of Pre.E and OH, which are conditions more specific to pregnancy.AFE is around the origin and does not affect either one of the budgets.It should be noted that CVD and Pre.E are the ones with the strongest influence on their respective budgets because they are farther away from the origin.Looking at the mixing parameters we can see that Black women belong to LB2,that is Black women have a strong connection to more general conditions, and Hispanic foreign-born women are mostly affected by specific pregnancy conditions.The three budgets model is shown in Figure 5. CVD and Pre.E each form a budget, LB1 and LB3 respectively; LB2 is composed of DVTPE and OH.Most important is to see that Hispanic foreign born women are strongly connected to Pre.E and Black women to CVD.This gives more emphasis to the K = 2 model results.

Example 4; post-materialism data
One theory of post-materialism states that political values change with the industrial and economic growth of a society.It says that people can be classified into two major groups with respect to their political values, namely materialistic, who seek security and materialistic supply, and post-materialistic, who try to bring about idealistic goals.Those two views, according to the theory, could be regarded as The R Journal Vol.10/1, July 2018 ISSN 2073-4859 the extremes of a continuum.The dataset consists of seven categories ranking from materialism (m..) to post-materialism (pm..) from a survey across Europe coded in a contingency table with 13 countries (rows) and the 7 levels of the in depth post-materialism index.
The complete table is part of the postmater dataset contained in package lba.In order to find out how many typical societies are needed to explain the data, four for K = 1, 2, 3, and 4 were estimated using the MLE method and the outer extreme solution so that the latent budgets representing the materialistic and post-materialistic concepts become as clear as possible.The goodness of fit results by using the goodnessfit using the G 2 function are displayed in Table 7 We will now discuss the graphical results from the function plotcorr.col.budget = gray20 , args.legend = list(plot = FALSE)) > plotcorr(ex4, with.ml= "lat", main = "Latent Components", pch.points = 20, + col.points = 4, labels.points= rownames(ex4$Boi), col.budget = gray20 , + args.legend= list(plot = FALSE)) In the first graph shown in Figure 6, K = 4 and the plot has 3 dimensions.In both plots, mixing parameters and latent components (the third dimension principal component) explain a negligible percentage of the inertia.This means that a two dimensional plot explains as much of the total information as the three dimensional one.
• LB2 consisting of pm, pm. and pm.. which means the most post-materialistic countries.
• LB3 consisting of m., m and m pm which means materialistic countries leaning to post-materialism.
The mixing parameters show that: • The materialistic countries, belonging to LB1, are: Greece, Northern Ireland and Ireland.
• Those in midway, belonging to LB3, are: Belgium and Italy.
• The post-materialistic countries, belonging to LB2, are: France, Germany and Netherlands.
• We could say that Great Britain and Luxembourg are in a group and Spain is also in a group apart.Portugal is midway between LB1 and LB3.
The R Journal Vol.10/1, July 2018 ISSN 2073-4859 Mixing Parameters q q q q q q q q q q q q q F B NL

Latent Components
Dim 2 (9.57%) q q q q q q q m.. Finally, it becomes very interesting when we look at Figure 9, only the mixing parameters for K = 2.
In this case there are two budgets; LB1 representing the post-materialism and LB2 representing the materialism.The graph shows a clear continuum from materialistic to post-materialistic countries where some groups, as we go from one end to another, become clear.They are: • Greece, Ireland, Northern Ireland, and Portugal the most materialistic, • Belgium and Spain, • Great Britain, Italy, and Luxembourg • Denmark, France, and Germany, • Netherlands the most post-materialistic.For more details see Van der Ark (1999a) page 172.
The lba package permits different approaches in latent budget analysis, much more than we could possibly bring to this article, and we strongly suggest the reading of Van der Ark (1999a) to get a full idea of them.

Conclusion
We have presented the lba package for latent budget analysis, which is derived from "A freeware computer program to perform latent budget analysis" (Van der Ark, 1999b).All unconstraint and constraint methods found in Van der Ark (1999a) were implemented.
We added some new features, such as the possibility to assign any value between zero and one as a fixed value constraint for both mixing parameters and latent components, and the implementation of two types of plots, which greatly facilitates the interpretation of the model.
The R Journal Vol.10/1, July 2018 ISSN 2073-4859 Mixing Parameters q q q q q q q q q q q q F B NL

Latent Components
Dim 2 (7.11%) q q q q q q q m..The lba package does not have the capability to analyze longitudinal data and neural networks yet.It is part of our plan to add those features to the package's capabilities.
Our next goal is to implement a new algorithm to perform identification to to replace the alabama package.This might be less computationally time consuming.
All the programming in R was done through the Tinn-R interface (Faria et al., 2015).

Mixing Parameters
−2 −1 0 1 2 q q LB1 LB2 q q q q q q q q q q q q q F B NL D I L DK IRL GB NIRL GR E P 0.5 un.0.5 un.

Figure 1 :
Figure 1: Computation time as a function of the data matrix dimensions and the number of latent budgets.

Table 1 :
Goodness of fit calculated by the lba package.

Table 2 :
Table2shows the number of deaths related to the five conditions for women with BMI less than 30, between 30 and 40 and above 40.The lba function was performed on data matrix bmi, as shown below.Number of deaths related to the five conditions for women with BMI less than 30, between 30 and 40 and above 40

parity, maternal age, gestational age at delivery in weeks
The first latent budget (LB1) is composed of CVD andThe R Journal Vol.10/1, July 2018 ISSN 2073-4859 DVTPE, which could be considered as pregnancy-related conditions; the second latent budget (LB2) is composed of AFE and Pre.E, which are more general conditions.The OH condition can be considered neutral.The mixing parameter BMI less than 30 is related to LB2 and the more obese women to LB1 as is expected since obese people are more affected by the general conditions.

Table 3 :
Relation between, parity, maternal age, gestational age at delivery with five cause of pregnancy related death

Table 4 ,
the function goodnessfit is used as follows.

Table 5 :
Relation between maternal race and country of birth with five causes of pregnancy related death

Table 6 :
Goodness of fit of LBM using MLE and K= 1, 2 and 3.