#!/usr/bin/perl -w # file to , leans heavily on: ## $Header: /cys/people/brenner/http/docs/web/perl5/RCS/simple-form.cgi,v 1.5 1996/03/29 22:58:40 brenner Exp $ ## Copyright (C) 1994 Steven E. Brenner # this file was written by Chris Evans (http://www.psyctc.org/cgi-bin/mailto.pl?webmaster) # and, though it's trivial, I claim copyright on it # However, you may copy it freely provided: # 1) you don't make a profit out of copying it or using it # 2) or if you do, you liaise with me about it and we strike a deal!! # 3) you don't change it any way (particularly not removing this stuff!) # 4) or if you do change it, you liaise with me, and, with suitable credit # to you, we improve the original in line with what you've done! # The correct citation for this file is: # Evans (1998) rcsc1.prl http://www.psyctc.org/stats/rcsc1.prl # 24.v.98 require 5.001; use strict; require "/usr/lib/cgi-bin/cgi-lib.pl"; MAIN: { my (%input, # The CGI data then the following are munged $rel, $sd, $data_there, $se_change, $rc_crit, $width, $dp, $field, $high_start, $low_start, $high_start_end_rel, $high_start_end_rel_drop, $high_start_end_not_rel, $low_start_end_not_rel, $low_start_end_rel); # Each of the fields (used for testing) # $width and $dp set the output format $width = 8; $dp = 2; # Read in all the variables set by the form &ReadParse(\%input); # Check that what's needed has been entered $data_there = 1; foreach $field (qw(rel sd)) { $data_there = 0 if !(length($input{$field})); } &CgiDie("Error: data missing\n") unless $data_there; # Print the header print &PrintHeader; print &HtmlTop ("Reliable change"); print "\n"; # get the data into variables $rel = $input{'rel'}; $sd = $input{'sd'}; # now process the data acquired if (!($rel =~ /[\d\.]/)) { &CgiDie("Reliability as read from your input = $rel\n

Reliability MUST be a number. Try again!\n"); } if ($rel <= 0) { &CgiDie("Reliability as read from your input = $rel\n

Reliability MUST be more than zero. Try again!\n"); } if ($rel > 1) { &CgiDie("Reliability as read from your input = $rel\n

Reliability MUST be less (or, implausibly, equal to) 1. Try again!\n"); } if ($rel == 1) { print "WARNING: Reliability as read from your input = $rel\n
Perfect reliability is highly implausible.

\n"; } if ($rel <= .5) { print "WARNING: Reliability as read from your input = $rel\n
That's rather poor reliability!\n

\n"; } if (!$sd =~ /[\d\.]/) { &CgiDie("s.d. as read from your input = $sd\n

s.d. MUST be a number. Try again!\n"); } if ($sd <= 0) { &CgiDie("s.d. as read from your input = $sd\n

s.d. MUST be more than zero. Try again!\n"); } # calculate reliable change criterion $se_change = $sd*(sqrt(2))*sqrt(1-$rel); $rc_crit = 1.96*$se_change; print "You entered: Reliability = $rel\n s.d. = $sd
"; printf "The standard error of change given these values is %${width}.${dp}f
\n",$se_change; printf "The reliable change criterion (RC, RCrit or RCCrit) is 1.96 times this, i.e. %${width}.${dp}f
\n",$rc_crit; print "Change, up or down, greater than this should be regarded as reliable.
"; $high_start = 1.4*$rc_crit; $low_start = 0.8*$rc_crit; $high_start_end_rel = 0.2*$rc_crit; $high_start_end_rel_drop = $high_start - $high_start_end_rel; $high_start_end_not_rel = 0.7*$rc_crit; $low_start_end_not_rel = 0; $low_start_end_rel = 0 - 0.7*$rc_crit; $width = 4; $dp = 2; printf "

For example, if you had a client with a starting score on the change measure of %${width}.${dp}f",$high_start; printf " and his or her end score was %${width}.${dp}f",$high_start_end_rel; print " then that was reliable change because there"; printf "was a drop of %${width}.${dp}f",$high_start_end_rel_drop; printf " which is greater than reliable change criterion you calculated of %${width}.${dp}f",$rc_crit; print " That means that this was a reliable improvement (assuming that a drop in score is an improvement!)"; print " I.e. it is a change in that direction that would be expected less than 2.5% of the time if the"; print " only source of change were unreliability of measurement."; printf "

By contrast, someone starting from the same score who ended up on %${width}.${dp}f",$high_start_end_not_rel; printf " would not have achieved reliable improvement as the drop is less than %${width}.${dp}f",$rc_crit; printf "

To give another example, someone starting on %${width}.${dp}f",$low_start; printf " who drops to %${width}.${dp}f",$low_start_end_not_rel; printf " cannot have achieved reliable improvement as again, that change is not more than %${width}.${dp}f",$rc_crit; printf " However, had they dropped (if the scale allows it) to %${width}.${dp}f",$low_start_end_rel; printf " then clearly they have dropped by more than %${width}.${dp}f",$rc_crit; print " and so they have shown a reliable improvement."; print "

All the same applies for people whose scores deteriorate, i.e."; print " get higher in the example of a problem scored measure that I'm using.
"; printf " Here again, changes more than %${width}.${dp}f",$rc_crit; print " are reliable change but those changes are reliable deteriorations not improvements."; print "\n


\n"; # Close the document cleanly. print &HtmlBot; }