nomLORgee(formula, data, id = id, repeated = NULL,
bstart = NULL, LORstr = "time.exch", LORem = "3way", LORterm = NULL,
add = 0, homogeneous = TRUE, control = LORgee.control(),
ipfp.ctrl = ipfp.control(), IM = "solve")formula, id and repeated."independence", "time.exch", "RC" or "fixed"."3way") or independently at each level pair of repeated ("2way").LORstr="fixed".LORstr="time.exch" or "RC".ipfp."solve", "qr.solve" or "cholesky"."LORgee". This has components:terms structure describing the marginal model.contrasts used for the factors.id variable.repeated variable.ipfp.add.pvalue of the Null model corresponds to the hypothesis $H_0: \beta_1=...=\beta_{J-1}=0$ based on the Wald test statistic.data must be provided in case level or equivalently in `long' format. See details about the `long' format in the function reshape.
A term of the form offset(expression) is allowed in the right hand side of formula.
The default set for the response categories is ${1,\ldots,J}$, where $J>2$ is the maximum observed response category. If otherwise, the function recodes the observed response categories onto this set.
The $J$-th response category is treated as baseline.
The default set for the id labels is ${1,\ldots,N}$, where $N$ is the sample size. If otherwise, the function recodes the given labels onto this set.
The argument repeated can be ignored only when data is written in such a way that the $t$-th observation in each cluster is recorded at the $t$-th measurement occasion. If this is not the case, then the user must provide repeated. The suggested set for the levels of repeated is ${1,\ldots,T}$, where $T$ is the number of observed levels. If otherwise, the function recodes the given levels onto this set.
The variables id and repeated do not need to be pre-sorted. Instead the function reshapes data in an ascending order of id and repeated.
The fitted marginal baseline category logit model is
$$log \frac{Pr(Y_{it}=j |x_{it})}{Pr(Y_{it}=J |x_{it})}=\beta_{0j} +\beta^{'}_j x_{it}$$
where $Y_{it}$ is the $t$-th multinomial response for cluster $i$, $x_{it}$ is the associated covariates vector, $\beta_{0j}$ is the $j$-th response category specific intercept and $\beta_{j}$ is the $j$-th response category specific parameter vector.
The LORterm argument must be an $L$ x $J^2$ matrix, where $L$ is the number of level pairs of repeated. These are ordered as $(1,2), (1,3), ...,(1,T), (2,3),...,(T-1,T)$ and the rows of LORterm are supposed to preserve this order. Each row is assumed to contain the vectorized form of a probability table that satisfies the desired local odds ratios structure.## See the interpretation in Touloumis (2011).
data(housing)
fitmod <- nomLORgee(y~factor(time)*sec,data=housing,id=id)
summary(fitmod)Run the code above in your browser using DataLab