# matrixLOR: Creating A Probability Matrix With Specified Local Odds... In multgee: GEE Solver for Correlated Nominal or Ordinal Multinomial Responses

## Description

Utility function to create a square probability matrix that satisfies the specified local odds ratios structure.

## Usage

 `1` ```matrixLOR(x) ```

## Arguments

 `x` a square matrix with positive entries that describes the desired local odds ratios matrix.

## Details

This function is designed to ease the construction of the `LORterm` argument in the functions nomLORgee and ordLORgee.

## Value

Returns a square probability matrix that satisfies the local odds ratios structure defined by `x`.

## Warning

Caution is needed for local odds ratios close to zero.

## Author(s)

Anestis Touloumis

nomLORgee and ordLORgee.

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16``` ```## Illustrating the construction of a "fixed" local odds ratios structure ## using the arthritis dataset. Here, we assume a uniform local odds ratios ## structure equal to 2 for each time pair. ## Create the uniform local odds ratios structure. lorterm <- matrixLOR(matrix(2,4,4)) ## Create the LORterm argument. lorterm <- c(lorterm) lorterm <- matrix(c(lorterm),3,25,TRUE) ## Fit the marginal model. data(arthritis) fitmod.fixed <- ordLORgee(y~factor(trt)+factor(time)+factor(baseline),data=arthritis, id=id,repeated=time,LORstr="fixed",LORterm=lorterm) fitmod.fixed ```

### Example output

```Loading required package: gnm
Call:
ordLORgee(formula = y ~ factor(trt) + factor(time) + factor(baseline),
data = arthritis, id = id, repeated = time, LORstr = "fixed",
LORterm = lorterm)

Number of clusters: 301
Maximum cluster size: 3

Number of categories: 5
Number of observations: 888

Coefficients:
beta10            beta20            beta30            beta40
-1.8362948214      0.2693444384      2.2321986900      4.5280320442
factor(trt)2     factor(time)3     factor(time)5 factor(baseline)2
-0.5134738174     -0.0008047854     -0.3645328663     -0.6702606753
factor(baseline)3 factor(baseline)4 factor(baseline)5
-1.2603788984     -2.6426918872     -3.9702756952

Number of iterations: 6
Algorithm converged: TRUE

Local Odds Ratios Structure[1:6,1:6]
[,1] [,2] [,3] [,4] [,5] [,6]
[1,]    0    0    0    0    2    2
[2,]    0    0    0    0    2    2
[3,]    0    0    0    0    2    2
[4,]    0    0    0    0    2    2
[5,]    2    2    2    2    0    0
[6,]    2    2    2    2    0    0

pvalue of Null model: <0.0001
```

multgee documentation built on July 12, 2017, 1:02 a.m.