multinomTanh
fits the overdispersed multinomial regression
model for grouped count data using the hyperbolic tangent (tanh)
estimator. This function is not meant to be called directly by the
user. It is called by multinomRob
, which constructs the
various arguments.
multinomTanh(Y, Ypos, X, jacstack, xvec, tvec, pop, s2, xvar.labels, choice.labels, print.level = 0)
NA
values) are not allowed.pop <- apply(Y * ifelse(Ypos,1,0), 1, sum)
.mGNtanh
.Y
. The first
column of the matrix has names for the observations, and the remaining
columns contain the weights. Each of the latter columns has a name
derived from the choice.labels
vector: column i+1
is named
paste("weights:",choice.labels[i],sep="")
.If sum(Ypos[i,]==FALSE)>0
, then values of NA
appear in
weights[i,]
, with sum(is.na(weights[i,]))==sum(!Ypos[i,])
.
The NA
values will be the last values in the affected
row of the weights
matrix, regardless of which outcome alternatives
were unavailable for the observation.Y
. The first column of the matrix has names for the observations,
and the remaining columns contain the weights. Each of the latter columns
has a name derived from the choice.labels
vector: column i+1
is named paste("Hdiag:",choice.labels[i],sep="")
.If sum(Ypos[i,]==FALSE)>0
, then values of 0 appear in
Hdiag[i,]
, with sum(is.na(Hdiag[i,]))==sum(!Ypos[i,])
.
The 0
values created for this reason will be the last values in the
affected row of the Hdiag
matrix, regardless of which outcome
alternatives were unavailable for the observation.NA
is used to denote that no regressor is
associated with the corresponding value in the matrix. The value 0 is
used in the matrix to fill in for values that do not correspond to a
regressor.For additional documentation please visit http://sekhon.berkeley.edu/robust/.