Learn R Programming

repolr (version 1.0)

srepolr: Explore Sensitivity of repolr

Description

Determines the logarithm of the determinant of the covariance matrix of the regression parameters (the logarithm of the generalized variance) from a previous fit of repolr for an arbitrary correlation parameter.

Usage

srepolr(data, mod.gee, alpha = 0.5)

Arguments

data
a dataframe in which to interpret the model fitted by repolr
mod.gee
a fitted model from repolr
alpha
a value for the correlation parameter

Value

  • Returns logarithm of the determinant of the covariance matrix.

Examples

Run this code
## fit ar1 correlation model to hip resurfacing pain data
data(HHSpain)
fitted.mod <- repolr(HHSpain~factor(Sex)*factor(Time), subjects="Patient",
data=HHSpain, categories=4, times=c(1,2,5), corstr="ar1", alpha=0.5)

## plot sensitivity
sensit <- vector(length=81); alphas <- seq(0.1,0.9,0.01)
for (j in 1:81){
sensit[j] <- srepolr(mod.gee=fitted.mod,alpha=alphas[j],data=HHSpain)
}
Nsensit <-sensit/
srepolr(mod.gee=fitted.mod, alpha=fitted.mod[["corr"]]$alpha, data=HHSpain)
plot(x=alphas,y=Nsensit,type="l",lwd=2)

Run the code above in your browser using DataLab