# NOT RUN {
# 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]]
# }
Run the code above in your browser using DataLab