MLfitGB2 | R Documentation |
The function mlfit.gb2
makes a call to ml.gb2
and profml.gb2
. Estimates of the GB2 parameters are calculated using maximum likelihood estimation based on the full and profile log-likelihoods. Empirical estimates of the set of primary indicators of poverty and social inclusion are calculated using the function main.emp
(see package laeken
) and these estimates
are compared with the indicators calculated with the GB2 fitted parameters using the function main.gb2
.
main.emp(z, w=rep(1, length(z))) mlfit.gb2(z, w=rep(1, length(z)))
z |
numeric; vector of data values. |
w |
numeric; vector of weights. Must have the same length as |
A list containing three different objects. The first is a data frame with the values of the fitted parameters for the full log-likelihood and the profile log-likelihood, the values of the two likelihoods, the values of the GB2 estimates of the indicators and the values of the empirical estimates of the indicators. The second and third objects are, respectively, the fit using the full log-likelihood and the fit using the profile log-likelihood.
Monique Graf and Desislava Nedyalkova
optim
, ml.gb2
, profml.gb2
# An example of using the function mlfit.gb2 # See also the examples of ml.gb2 and mlprof.gb2 ## Not run: library(laeken) data(eusilc) # Income inc <- as.vector(eusilc$eqIncome) # Weights w <- eusilc$rb050 # Data set d <- data.frame(inc, w) d <- d[!is.na(d$inc),] # Truncate at 0 inc <- d$inc[d$inc > 0] w <- d$w[d$inc > 0] # ML fit m1 <- mlfit.gb2(inc,w) # GB2 fitted parameters and indicators through maximum likelihood estimation m1[[1]] # The fit using the full log-likelihood m1[[2]] # The fit using the profile log-likelihood m1[[3]] # ML fit, when no weights are avalable m2 <- mlfit.gb2(inc) # Results m2[[1]] ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.