In a clinical study a sample of 127 patients with sport related injuries have been treated with two different therapies (chosen by random design). After 3,7 and 10 days of treatment the pain occuring during knee movement was observed. The dataset is available as knee{catdata}. Analyze the effects of gender and age on the level of pain, (R1 = 0, no pain, …, 5 = severe pain), before treatment started. You may consult the package vignette for an analysis on the variable R4 by issuing the command in your R session:

data(knee, package=“catdata”)
vignette(“ordinal-knee1”)

1 load package

pacman::p_load(tidyverse, MASS, pscl)

2 Input data

data(knee, package="catdata")
head(knee)
##   N Th Age Sex R1 R2 R3 R4
## 1 1  1  28   1  4  4  4  4
## 2 2  1  32   1  4  4  4  4
## 3 3  1  41   1  3  3  3  3
## 4 4  2  21   1  4  3  3  2
## 5 5  2  34   1  4  3  3  2
## 6 6  1  24   1  3  3  3  2
str(knee)
## 'data.frame':    127 obs. of  8 variables:
##  $ N  : int  1 2 3 4 5 6 7 8 9 10 ...
##  $ Th : int  1 1 1 2 2 1 2 2 2 1 ...
##  $ Age: int  28 32 41 21 34 24 28 40 24 39 ...
##  $ Sex: num  1 1 1 1 1 1 1 1 0 0 ...
##  $ R1 : int  4 4 3 4 4 3 4 3 4 4 ...
##  $ R2 : int  4 4 3 3 3 3 3 2 4 4 ...
##  $ R3 : int  4 4 3 3 3 3 3 2 4 4 ...
##  $ R4 : int  4 4 3 2 2 2 2 2 3 3 ...
dta_3<-reshape2::melt(knee[,5:8], key=, value=value)
## No id variables; using all as measure variables
names(dta_3)<-c("Measure Time", "Pain level")
summary(m0_dta_3<-polr(factor(dta_3$`Pain level`)~factor(dta_3$`Measure Time`), method = "probit",Hess=T))
## Call:
## polr(formula = factor(dta_3$`Pain level`) ~ factor(dta_3$`Measure Time`), 
##     Hess = T, method = "probit")
## 
## Coefficients:
##                                  Value Std. Error t value
## factor(dta_3$`Measure Time`)R2 -0.3476     0.1335  -2.604
## factor(dta_3$`Measure Time`)R3 -0.5326     0.1342  -3.968
## factor(dta_3$`Measure Time`)R4 -0.7395     0.1354  -5.460
## 
## Intercepts:
##     Value    Std. Error t value 
## 1|2  -1.1634   0.1073   -10.8458
## 2|3  -0.7974   0.1042    -7.6538
## 3|4  -0.1022   0.1003    -1.0183
## 4|5   0.9509   0.1075     8.8467
## 
## Residual Deviance: 1523.003 
## AIC: 1537.003