#RCI for change in MHC
JTRCI(data = i3time.wide, 
      ppid = "id", 
      pre = "wellbeing.1", 
      post = "wellbeing.3",  
      reliability = .9, 
      indextype = "RCI", #or index type can be 'JT'
      JTcrit = "auto",
            higherIsBetter = T,
            plottitle = "Mental Health Continuum",
            plot = T,
            table = T)
##    reliable change classification N
## 1:          reliably deteriorated 2
## 2:             no reliable change 4
## 3:              reliably improved 1

#RCI for change in MHC, grouped by gender
JTRCI(data = i3time.wide, 
      ppid = "id", 
      pre = "wellbeing.1", 
      post = "wellbeing.3",  
            group = "gender.f",
      reliability = .9, 
      indextype = "RCI", #or index type can be 'JT'
      JTcrit = "auto",
            higherIsBetter = T,
            plottitle = "Mental Health Continuum by Gender",
            plot = T,
            table = T,
         facetplot = T)
##    reliable change classification man/boy non-binary woman/girl
## 1:          reliably deteriorated       2          0          0
## 2:             no reliable change       1          1          2
## 3:              reliably improved       1          0          0

#RCI for change in DASS
JTRCI(data = i3time.wide, 
      ppid = "id", 
      pre = "depression.1", 
      post = "depression.3",  
      reliability = .9, 
      indextype = "RCI", #or index type can be 'JT'
            plottitle = "Depression and Anxiety",
      JTcrit = "auto",
            higherIsBetter = F,
            plot = T,
            table = T)
##    reliable change classification N
## 1:          reliably deteriorated 3
## 2:             no reliable change 2
## 3:              reliably improved 2

#RCI for change in DASS, grouped by gender
JTRCI(data = i3time.wide, 
      ppid = "id", 
      pre = "depression.1", 
      post = "depression.3",  
            group = "gender.f",
      reliability = .9, 
            plottitle = "Depression and Anxiety by Gender",
      indextype = "RCI", #or index type can be 'JT'
      JTcrit = "auto",
            higherIsBetter = F,
            plot = T,
            table = T,
        facetplot = T)
##    reliable change classification man/boy non-binary woman/girl
## 1:          reliably deteriorated       2          0          1
## 2:             no reliable change       1          0          1
## 3:              reliably improved       1          1          0

JTRCI(data = i3time.wide, 
      ppid = "id", 
      pre = "sears.1", 
      post = "sears.3",  
      reliability = .9, 
      indextype = "RCI", #or index type can be 'JT'
            plottitle = "SEARS",
      JTcrit = "auto",
            higherIsBetter = T,
            plot = T,
            table = T)
##    reliable change classification N
## 1:          reliably deteriorated 0
## 2:             no reliable change 8
## 3:              reliably improved 3

#RCI for change in SEARS, grouped by gender
JTRCI(data = i3time.wide, 
      ppid = "id", 
      pre = "sears.1", 
      post = "sears.3",  
            group = "gender.f",
            plottitle = "SEARS by Gender",
      reliability = .9, 
      indextype = "RCI", #or index type can be 'JT'
      JTcrit = "auto",
            higherIsBetter = T,
            plot = T,
            table = T,
         facetplot = T)
##    reliable change classification man/boy non-binary woman/girl
## 1:          reliably deteriorated       0          0          0
## 2:             no reliable change       3          4          1
## 3:              reliably improved       1          1          1

#RCI for change in SE
JTRCI(data = i3time.wide, 
      ppid = "id", 
      pre = "self.efficacy.1", 
      post = "self.efficacy.3",  
      reliability = .9, 
            plottitle = "Self-Efficacy",
      indextype = "RCI", #or index type can be 'JT'
      JTcrit = "auto",
            higherIsBetter = T,
            plot = T,
            table = T)
##    reliable change classification N
## 1:          reliably deteriorated 0
## 2:             no reliable change 7
## 3:              reliably improved 1

#RCI for change in SE, grouped by gender
JTRCI(data = i3time.wide, 
      ppid = "id", 
      pre = "self.efficacy.1", 
      post = "self.efficacy.3",  
            group = "gender.f",
      reliability = .9, 
            plottitle = "Self-Efficacy by Gender",
      indextype = "RCI", #or index type can be 'JT'
      JTcrit = "auto",
            higherIsBetter = T,
            plot = T,
            table = T,
            facetplot = T)
##    reliable change classification man/boy non-binary woman/girl
## 1:          reliably deteriorated       0          0          0
## 2:             no reliable change       4          2          1
## 3:              reliably improved       0          0          1

# RCI on two time points

########## CHANGE IN SEARS ##########

JTRCI(data = i3time.wide, 
      ppid = "id", 
      pre = "sears.1", 
      post = "sears.2",  
      reliability = .9, 
      indextype = "RCI", #or index type can be 'JT'
            plottitle = "SEARS",
      JTcrit = "auto",
            higherIsBetter = T,
            plot = T,
            table = T)
## NB 1 cases have missing data - these are ommitted from the calculations
## Assumed that higher scores are better (and increased scores == improvement),
##  if that is incorrect: set higherIsBetter = F
##    reliable change classification N
## 1:          reliably deteriorated 0
## 2:             no reliable change 8
## 3:              reliably improved 2

########## CHANGE IN SELF EFFICACY ##########

#RCI for change in SE
JTRCI(data = i3time.wide, 
      ppid = "id", 
      pre = "self.efficacy.1", 
      post = "self.efficacy.2",  
      reliability = .9, 
            plottitle = "Self-Efficacy",
      indextype = "RCI", #or index type can be 'JT'
      JTcrit = "auto",
            higherIsBetter = T,
            plot = T,
            table = T)
## NB 5 cases have missing data - these are ommitted from the calculations
## 
## Assumed that higher scores are better (and increased scores == improvement),
##  if that is incorrect: set higherIsBetter = F
##    reliable change classification N
## 1:          reliably deteriorated 0
## 2:             no reliable change 5
## 3:              reliably improved 1