T_Data contains outcome which is in 6 levels. 'Assign' takes on a value of a '1' or a '0'. T_Data contains 221 subjects with 'Assign' value of '1' and 307 with a 'Assign' value of '0'. I did a proportional odds logistic regression using 'polr' using the code below
### Ordinal Logistic Regression
schtyp.f <- factor(T_Data$outcome, labels = c("M0", "M1", "M2", "M3", "M4", "M5"))
m <- polr(schtyp.f ~ Assign, data = T_Data, Hess=TRUE)
summary(m)
## store table
(ctable <- coef(summary(m)))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
print(ctable <- cbind(ctable, "p value" = p))
## End of Ordinal Logistic Regression
I performed a 1:1 matching based on other variables and the matched pairs are numbered from 1 to 221 and in a column 'Match_ID'.
How would I do matched ordinal logistic regression?
I first made a data structure m_polr. Column variables are 'Assign', 'Outcome', and 'Match_pair_id'. 'Assign' takes on values 1 or zero, 'Outcome' takes on values 0 to 6, and 'Matched_pair_id' takes on values 1,2,...221. Note that there are 221 matched pairs.
cat("\n")
cat("********* Matched Proportional Ordinal Logistic regression ************\n")
cat("\n")
### Ordinal Logistic Regression
rm(ctable, schtyp.f, m, p)
schtyp.f <- factor(m_polr$Outcome, labels = c("M0", "M1", "M2", "M3", "M4", "M5", "M6"))
m <- polr(schtyp.f ~ Assign + Match_pair_id, data = m_polr, Hess=TRUE)
summary(m)
## store table
(ctable <- coef(summary(m)))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
print(ctable <- cbind(ctable, "p value" = p))