Repeated measures proportional odds logistic regression
Method
Repeated measures proportional odds logistic regression models correlated repeat ordinal scores using the method suggested by Parsons et al. (2006). Code for model fitting runs in the free statistical software R. Before sourcing the repolr functions, download R and the latest version of the GEE solver package gee. Two example data sets are available (Example 1: Achilles tendon data and Example 2: Hip resurfacing data) and code for analysis and a description of implementation is given below.
Code
The source functions for R implementation of repolr must be loaded prior to model fitting.
Example 1: Achilles tendon data
Example data is from a clinical trial of treatment post-surgery after rupture of the Achilles tendon. Reads data from user defined location, loads gee library, fits model and summarises.
# example code
achilles.dat <- read.table(“c:/data location/achilles_data.txt”,
col.names=c("Patient","Treat","Time","Activity"),header=T)
attach(achilles.dat)
library(gee)
source(“c:/function location/repolr_functions.R”)
fitted.mod <- repolr(formula = Activity ~ factor(Treat) * Time ,
subjects = "Patient" , data = achilles.dat ,
categories = 3 , times = c(1,2,3) , corstr = "ar1",
tol = 0.001, scalevalue = 1, alpha = 0.5,
po.test=TRUE, fixed=FALSE)
summary(fitted.mod[["gee"]])
fitted.mod[["corr"]]
Implementation
The user is required to specify:
(i) a data set name (data)
(ii) a model formula (formula)
(iii) a cluster identification variable (subjects)
(iv) a time variable (time)
(v) and the number of categories used for the response variable (categories)
The data set may contain records with missing data for either the response variable or the explanatory variables. The response variable must have at least three ordered categories (K>=3)
Additionally there are a number of other algorithm related options. A fixed scale parameter (scalevalue) is assumed to be 1, but otherwise it can be set to any positive value
The functions require the user to have pre-installed the latest version of the R GEE solver gee and the fitted model (fitted.mod[["gee"]]) inherits the class attributes of this package; correlation model ouput is available from fitted.mod[["corr"]].
Example 2: Hip resurfacing data
Example data is from a clinical trial of treatment post-surgery after hip resurfacing.
# example code
pain.dat <- read.table(“c:/data location/pain_data.txt”,
col.names=c("Patient","Sex","Time","HHSpain"),header=T)
attach(pain.dat)
library(gee)
source(“c:/function location/repolr_functions.R”)
fitted.mod <- repolr(formula = HHSpain ~ factor(Sex) * factor(Time) ,
subjects = "Patient" , data = pain.dat ,
categories = 4 , times = c(1,2,5) , corstr = "ar1",
tol = 0.001, scalevalue = 1, alpha = 0.5,
po.test=TRUE, fixed=FALSE)
summary(fitted.mod[["gee"]])
fitted.mod[["corr"]]
# plot profile likelihood
proflik <- vector(length=81)
alphas <- seq(0.1,0.9,0.01)
for (j in 1:81){
proflik[j] <- srepolr(mod.gee=fitted.mod,alpha=alphas[j],data=HHSpain.dat)
}
Nproflik <- proflik/srepolr(mod.gee=fitted.mod,alpha=fitted.mod[["corr"]]$alpha,data=HHSpain.dat)
plot(x=alphas,y=Nproflik,type="l",lwd=2)
References
Parsons, NR, Edmondson, RN and Gilmour, SG, (2006) 'A generalized estimating equation method for fitting autocorrelated ordinal score data with an application in horticultural research.' Applied Statistics 55, 507 - 524.