#! /usr/bin/R sink(file="/dev/null") # to stop getting the Hmisc announcement text graphDir <- "/var/psyctc/psyctc.org/stats/R/CSC1/scratch/" graphURLroot <- "/stats/R/CSC1/scratch/" if(length(system(paste("ls ",graphDir,"*.png",sep=""), intern=TRUE)) > 0 ) system(paste("rm ",graphDir,"*.png",sep="")) sink() # switch output back to stdout tag(HTML) tag(HEAD) tag(TITLE) cat("Criteria for "Clinically Significant Change" (CSC)") untag(TITLE) untag(HEAD) lf(2) tag(BODY, bgcolor = "lime") lf(2) tag(center) cat("
") cat("Your input") cat(" | ") cat("") cat("|||
---|---|---|---|
")
now <- system('date +%Y-%m-%d,%T', intern=TRUE)
host <- system("echo $REMOTE_ADDR", intern=TRUE)
cat("Request from: ",host, " at", now," ") cat(" | ")
cat("|||
Clinical | Non-clinical | ") cat("||
") cat("Mean") cat(" | ") cat("") cat(cmean) cat(" | ") cat("") cat("Mean") cat(" | ") cat("") cat(ncmean) cat(" | ") cat("
") cat("s.d.:") cat(" | ") cat("") cat(csd) cat(" | ") cat("") cat("s.d.:") cat(" | ") cat("") cat(ncsd) cat(" | ") cat("
") cat("Minimum possible score on the measure: ") cat(" | ") cat("") cat(smin) cat(" | ") cat("||
") cat("Maximum possible score on the measure: ") cat(" | ") cat("") cat(smax) cat(" | ") cat("||
")
cat(" ") cat("Output produced at ", date()) cat(" ") cat(" | |||
") cat("Results for your parameters") cat(" | ") cat("|||
") cat("Criterion A:") cat(" | ") cat("") cat(crit.a.rnd) cat(" | ") cat("||
") cat("Criterion B:") cat(" | ") cat("") cat(crit.b.rnd) cat(" | ") cat("||
") cat("Criterion C:") cat(" | ") cat("") cat(crit.c.rnd) cat(" | ") file <- paste("tmp",host,".",now,".png",sep="") if (large) { webPNG(file=file,height=8,width=10,res=360) } else { webPNG(file=file,height=8,width=10,res=72) } ## nothing beyond here needs to be tweaked unless you want different plot formatting # get the Gaussian quantiles x <- seq(xmin,xmax,inc/100) # possible score range on a fairly tight plotting frequency nclin <- dnorm(x,ncmean,ncsd) clin <- dnorm(x,cmean,csd) # set up the plotting space plot(nclin,xlim=c(xmin,xmax),ylim=c(0,1),ylab="",xlab="",type="n") # put in vertical reference lines on the limits of the possible scores par(lwd=1) par(lty=2) abline(v=xmin) abline(v=xmax) # put in vertical reference lines on the two means par(adj=.5) par(lty=4) abline(v=ncmean) text(ncmean,.9,"Non-clin. mean") abline(v=cmean) text(cmean,.9,"Clinical mean") par(lty=1) # double the thickness of the lines and put in the Gaussian quantiles par(lty=1) par(lwd=2) lines(x,nclin) lines(x,clin) ## change colour (to red as coded here) for the Jacobson criteria par(col=2) abline(v=crit.c) text(crit.c,.8,"CSC criterion C") arrows(cmean,.75,crit.c,.75,col=2) arrows(ncmean,.75,crit.c,.75,col=2) abline(v=crit.a) par(adj=1) text(crit.a-inc,.6,"CSC criterion A") arrows(cmean,.55,crit.a,.55,col=2) abline(v=crit.b) par(adj=0) text(crit.b+inc,.4,"CSC criterion B") arrows(ncmean,.35,crit.b,.35,col=2) par(lty=1) par(adj=.5) par(col=1) graphics.off() img(src = file) ; br(2) cat("") cat("") cat("||
") cat("Explanation and advice for CORE system users and others") cat(" | ") cat("|||
")
cat("The logic of this was described in: ") cat(" Jacobson, N. S., Follette, W. C. & Revenstorf, D. (1984) Psychotherapy outcome research: methods for reporting variability and evaluating clinical significance. Behavior Therapy, 15, 336-352. ") cat("and nicely summarised in: ") cat(" Jacobson, N. S. & Truax, P. (1991) Clinical significance: a statistical approach to defining meaningful change in psychotherapy research. Journal of Consulting and Clinical Psychology, 59, 12-19. ") cat("and even more succinctly in: ") cat(" Evans, C., Margison, F. & Barkham, M. (1998) The contribution of reliable and clinically significant change methods to evidence-based mental health. Evidence Based Mental Health, 1, 70-72. ") cat("
All this is based on the model of Gaussian (infinite) population distributions.") cat(" The maths are probably robust to finite populations but will break down for") cat("markedly non-Gaussian distributions, i.e. the real world.") cat(" | ")
cat("|||
") cat("Technicalities") cat(" | ") cat("|||
") cat("Calculation done in R, CGI script written by Chris Evans using David Firth's excellent GGIwithR package which can be obtained from CRAN.. ") linkto("Contact me if something isn't working right ...", "http://www.psyctc.org/cgi-bin/mailto.pl?webmaster") ; br() lf() lf() cat(" | ") cat("