﻿*******************************************************************************************
*******VisQoL Score(with Missing values)  (CHE version 9 dated 30 November 2016) ****
**********************************************************************************
* THIS ALGORITHM (CHE version 9 dated 30 November 2016) MAY BE CHANGED WITHOUT NOTICE.
* RESEARCHERS SHOULD CHECK WITH THE AQOL GROUP AT MONASH UNIVERSITY
* FOR ANY MODIFICATION www.aqol.com.au***

************************************************************************

 *This file analyses the six items of the VisQoL dimension (the 7th dimension) of the AQoL-7D instrument and produces a VisQoL Dimension Value (not utility) which is then mapped to produce a PREDICTED AQoL-7D UTILITY.
***(Dimension scores are referred to as 'values' and 'disvalues' and are NOT utility scores as they have not been evaluated on a life-death scale).*
** If you have complete AQoL-7D data, use the AQoL-7D algorithm to obtain dimension values (not utilities) and the overall utility score.
** If necessary contact angelo.iezzi@monash.edu
***************************************************************
** Variable names: The AQoL-7D has 26 items; the last dimension, VisQol, covers items 21, 22,23,24,25 and 26. For this algorithm, the variables in your questionnaire 
** or database should be named "aqol21, aqol22, aqol23, aqol24, aqol25,aqol26".
**Data entry: The first response in any item, the item best, is entered as ‘1’, the second as ‘2’, third as ‘3’ and so on except for items 23 and 24. 
**In item 23 response level 7 is scored the same as level 2 (0.018) and in item 24 response level 6 is scored the same as response 1 (o.o)
   
*************************************************************
* The dimensions are scaled on a  "Dimension Worst Health State - Dimension Best Health State" scale
*  where DWHS = 0.00 and DBHS = 1.00. 
*************************************************************
*Missing Values: Note that missing data are represented by a blank and are handled by imputing values within the dimension.
*This algorithm allows for 2 missing values.
*However, if more item responses in the  dimension are missing the observations will be dropped and there will not be a dimension score.
**********************************************************************************
* aqol# are item responses in your data
* dvQ# are item disvalues 
* Missing values represented by a blank or dot.**
 


Compute Q21 = aqol21.
Compute Q22 = aqol22.
Compute Q23  = aqol23.
Compute Q24 = aqol24.
Compute Q25  = aqol25.
Compute Q26  = aqol26.
EXECUTE .


*********   IMPUTING MISSING VALUES IN DATABASE    *********   

** VisQoL - Dimension 7**

Compute VISmiss = Nmiss (Q21 to Q26).
Do if VISmiss <3.
Do repeat
  A = Q21 to Q26.
If (Missing (A)) A = RND(Mean (Q21 to Q26)).
End repeat.
End if.
Execute.





*** Dimension 7. VisQoL***

***21.Injure***

if (Q21=1) dvQ21=0.
if (Q21=2) dvQ21=0.096.
if (Q21=3) dvQ21=0.386.
if (Q21=4) dvQ21=0.687.
if (Q21=5) dvQ21=1.

***22. Cope with demand***

if (Q22=1) dvQ22=0.
if (Q22=2) dvQ22=0.019.
if (Q22=3) dvQ22=0.143.
if (Q22=4) dvQ22=0.360.
if (Q22=5) dvQ22=0.751.
if (Q22=6) dvQ22=1.

***23.Friendships***

if (Q23=1) dvQ23=0.
if (Q23=2) dvQ23=0.018.
if (Q23=3) dvQ23=0.226.
if (Q23=4) dvQ23=0.506.
if (Q23=5) dvQ23=0.764.
if (Q23=6) dvQ23=1.
if (Q23=7) dvQ23=0.018.

***24.Assistance***

if (Q24=1) dvQ24=0.
if (Q24=2) dvQ24=0.093.
if (Q24=3) dvQ24=0.295.
if (Q24=4) dvQ24=0.683.
if (Q24=5) dvQ24=1.
if (Q24=6) dvQ24=0.

***25.Roles***

if (Q25=1) dvQ25=0.
if (Q25=2) dvQ25=0.014.
if (Q25=3) dvQ25=0.142.
if (Q25=4) dvQ25=0.377.
if (Q25=5) dvQ25=0.733.
if (Q25=6) dvQ25=1.

***26. Confidence***

if (Q26=1) dvQ26=0.
if (Q26=2) dvQ26=0.012.
if (Q26=3) dvQ26=0.129.
if (Q26=4) dvQ26=0.342.
if (Q26=5) dvQ26=0.670.
if (Q26=6) dvQ26=1.
EXECUTE .


*****************************************************************************************************************************
***2. MODELLING DIMENSIONS
*****************************************************************************************************************************

***DIMENSION 7 - VIS

**DIMENSION SCALING CONSTANT kD7=-0.833
***VIS HAS 6 ITEMS
***ITEM WORST WEIGHTS (Wi) 
*w21= 0.2696557
* w22= 0.3697268 
* w23= 0.3078306
* w24= 0.2971339 
* w25= 0.3286885 
* w26= 0.2810792 

*dv is the disvalue (rather than disutility)

Compute dvD7=(1/-0.833)*((1+(-0.833*0.2696557*dvQ21))*(1+(-0.833*0.3697268*dvQ22))*(1+(-0.833*0.3078306*dvQ23))*
(1+(-0.833*0.2971339*dvQ24))*(1+(-0.833*0.3286885*dvQ25))*(1+(-0.833*0.2810792*dvQ26))-1).
EXECUTE.


**Variable D7 = "Score for Dimension 7 - VisQoL".


Compute INJURE=1-dvQ21.
Compute COPE=1-dvQ22.
Compute FRIENDSHIPS=1-dvQ23.
Compute ASSISTANCE=1-dvQ24.
Compute ROLES=1-dvQ25.
Compute CONFIDENCE=1-dvQ26.
Compute VisqolDimensionValue = (1- dvD7).  
EXECUTE.

VARIABLE LABELS INJURE 'AQoL-7D INJURY DIMENSION VALUE'.
COPE 'AQoL-7D COPING DIMENSION VALUE'.
FRIENDSHIPS 'AQoL-7D FRIENDSHIPS DIMENSION VALUE'.
ASSISTANCE 'AQoL-7D ASSISTANCE DIMENSION VALUE'.
ROLES 'AQoL-7D ROLES DIMENSION VALUE'.
CONFIDENCE 'AQoL-7D CONFIDENCE DIMENSION VALUE'.
VisqolDimensionValue ' VISQOL VALUE'.
EXECUTE.

Delete Variables Q21 Q22 Q23 Q24 Q25 Q26 VISmiss dvQ21 dvQ22 dvQ23 dvQ24 dvQ25 dvQ26 dvD7.
Execute.
