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 , ...)"xtabs" or "table" formula.NULL, producing random starting values.NULL, producing random starting values.1.NULL, producing random starting values.NULL, producing random starting values.NULL.NULL.NULL.NULL. If both row.weights and col.weights are NULL and "ls" method is chosen, then ordinary least squares is used.1e-10.1e-05.1e-05.1e3.1e3.base function optim and constrOptim.nl from package TRUE."all" when the one-iteration change in the estimated likelihood rati"ls" when least squares, either weighted or ordinary, method is
used; "mle" when maximum likelihood method is used. The default is "ls"."inner" extreme solution and the "outer" extreme solution. The default is "inner".lba.ls and lba.mle returns a list of class lba.ls and lba.mle respectively with the slots:P - pij.lba.ls.fe and lba.mle.fe returns a list of class lba.ls.fe and lba.mle.fe respectively with the slots:P - pij.lba.ls.logit and lba.mle.logit returns a list of class lba.ls.logit and lba.mle.logit respectively with the slots:P - pij.goodnessfit, summary.lba, plot.lbadata('votB')
# Using LS method (default) without constraint
# K = 2
ex1 <- lba(city ~ parties,
votB,
K = 2)
ex1
# Already tabulated data? Ok!
data('PerfMark')
ex2 <- lba(as.matrix(PerfMark),
K = 2,
what='outer')
ex2
# 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
exf1 <- lba(city ~ parties,
votB,
cA = cakiF1,
K = 3)
exf1Run the code above in your browser using DataLab