Difference between revisions of "CNP DDT"

From Pheno Wiki
Jump to: navigation, search
(No relation with age)
 
(7 intermediate revisions by one other user not shown)
Line 35: Line 35:
 
*** End. Thank you screen presented.  
 
*** End. Thank you screen presented.  
  
** Timing  
+
*Timing  
 
*** Instruction screen is static until advanced by examiner with a right mouse click.  
 
*** Instruction screen is static until advanced by examiner with a right mouse click.  
 
*** Presentation of trial with immediate and delayed options (no time limit). 
 
*** Presentation of trial with immediate and delayed options (no time limit). 
Line 129: Line 129:
 
The following is a DDT scoring script in Visual Basic language.  This script was provided by Stone Shih, and is based on a script developed by Cody Ashe-McNalley, Andy Dean, and John Monterosso.   
 
The following is a DDT scoring script in Visual Basic language.  This script was provided by Stone Shih, and is based on a script developed by Cody Ashe-McNalley, Andy Dean, and John Monterosso.   
  
Dim aryScore(10)
+
' Modification based on Cody Ashe-McNalley 11/12/08
for s = 1 to ubound(aryScore)
+
 
aryScore(s) = null
+
                dim slots(9), Trial_Data(9,3), TrialS7_Data(9,1), Discount_Rates(10), DiscountS7_Rates(10)
next
+
 
+
                Trial_Data(1, 1) = 0.00016
' Modification based on Cody Ashe-McNalley 11/12/08
+
 
dim slots(9), Trial_Data(9,3), Discount_Rates(10)
+
                Trial_Data(2, 1) = 0.0004
Trial_Data(1, 2) = 0.00016
+
 
Trial_Data(5, 3) = 0.006
+
                Trial_Data(3, 1) = 0.001
Trial_Data(5, 1) = 0.006
+
 
Trial_Data(9, 3) = 0.25
+
                Trial_Data(4, 1) = 0.0025
Trial_Data(7, 1) = 0.041
+
 
Trial_Data(2, 2) = 0.0004
+
                Trial_Data(5, 1) = 0.006
Trial_Data(8, 1) = 0.1
+
 
Trial_Data(8, 2) = 0.1
+
                Trial_Data(6, 1) = 0.016
Trial_Data(1, 3) = 0.00016
+
 
Trial_Data(5, 2) = 0.006
+
                Trial_Data(7, 1) = 0.041
Trial_Data(9, 1) = 0.25
+
 
Trial_Data(3, 3) = 0.001
+
                Trial_Data(8, 1) = 0.1
Trial_Data(1, 1) = 0.00016
+
 
Trial_Data(7, 2) = 0.041
+
                Trial_Data(9, 1) = 0.25
Trial_Data(4, 3) = 0.0025
+
 
Trial_Data(4, 2) = 0.0025
+
               
Trial_Data(2, 3) = 0.0004
+
 
Trial_Data(6, 1) = 0.016
+
                TrialS7_Data(1, 1) = 0.00016
Trial_Data(8, 3) = 0.1
+
 
Trial_Data(2, 1) = 0.0004
+
                TrialS7_Data(2, 1) = 0.0004
Trial_Data(6, 2) = 0.016
+
 
Trial_Data(4, 1) = 0.0025
+
                TrialS7_Data(3, 1) = 0.001
Trial_Data(7, 3) = 0.041
+
 
Trial_Data(3, 2) = 0.001
+
                TrialS7_Data(4, 1) = 0.0025
Trial_Data(6, 3) = 0.016
+
 
Trial_Data(3, 1) = 0.001
+
                TrialS7_Data(5, 1) = 0.006
Trial_Data(9, 2) = 0.25
+
 
+
                TrialS7_Data(6, 1) = 0.0098          '0.0098 (new S7 value)
' These values are the endpoints and geometric means of the k indifference values
+
 
Discount_Rates(1) = 0.00016
+
                TrialS7_Data(7, 1) = 0.016
Discount_Rates(2) = 0.000253
+
 
Discount_Rates(3) = 0.000632
+
                TrialS7_Data(8, 1) = 0.041
Discount_Rates(4) = 0.001581
+
 
Discount_Rates(5) = 0.003873
+
                TrialS7_Data(9, 1) = 0.25
Discount_Rates(6) = 0.009798
+
 
Discount_Rates(7) = 0.025612
+
               
Discount_Rates(8) = 0.064031
+
 
Discount_Rates(9) = 0.158114
+
                Trial_Data(1, 2) = 0.00016
Discount_Rates(10) = 0.25
+
 
+
                Trial_Data(2, 2) = 0.0004
+
 
Dim rank
+
                Trial_Data(3, 2) = 0.001
Dim Choice_Counts(10,3)
+
 
Dim TopScores()
+
                Trial_Data(4, 2) = 0.0025
Dim Inconsistencies(3) 'Indicator for inconsistent results
+
 
Dim Delayed_Choice(10,3)
+
                Trial_Data(5, 2) = 0.006
+
 
strSQL = "SELECT * FROM " & TableName & " where [Subject]=" & SubjectID
+
                Trial_Data(6, 2) = 0.016
Set ers = Server.CreateObject("ADODB.Recordset")
+
 
ers.Open strSQL, DataConn, adOpenStatic
+
                Trial_Data(7, 2) = 0.041
+
 
if ers.eof or ers.recordcount <> 27 then
+
                Trial_Data(8, 2) = 0.1
exit sub
+
 
end if
+
                Trial_Data(9, 2) = 0.25
+
 
do while not ers.eof
+
               
 +
 
 +
                Trial_Data(1, 3) = 0.00016
 +
 
 +
                Trial_Data(2, 3) = 0.0004
 +
 
 +
                Trial_Data(3, 3) = 0.001
 +
 
 +
                Trial_Data(4, 3) = 0.0025
 +
 
 +
                Trial_Data(5, 3) = 0.006
 +
 
 +
                Trial_Data(6, 3) = 0.016
 +
 
 +
                Trial_Data(7, 3) = 0.041
 +
 
 +
                Trial_Data(8, 3) = 0.1
 +
 
 +
                Trial_Data(9, 3) = 0.25
 +
 
 +
               
 +
 
 +
                ' These values are the endpoints and geometric means of the k indifference values
 +
 
 +
                Discount_Rates(1) = 0.00016
 +
 
 +
                Discount_Rates(2) = 0.000253
 +
 
 +
                Discount_Rates(3) = 0.000632
 +
 
 +
                Discount_Rates(4) = 0.001581
 +
 
 +
                Discount_Rates(5) = 0.003873
 +
 
 +
                Discount_Rates(6) = 0.009798
 +
 
 +
                Discount_Rates(7) = 0.025612
 +
 
 +
                Discount_Rates(8) = 0.064031
 +
 
 +
                Discount_Rates(9) = 0.158114
 +
 
 +
                Discount_Rates(10) = 0.25
 +
 
 +
               
 +
 
 +
                ' These values are the endpoints and geometric means of the k indifference values
 +
 
 +
                DiscountS7_Rates(1) = 0.00016
 +
 
 +
                DiscountS7_Rates(2) = 0.000253
 +
 
 +
                DiscountS7_Rates(3) = 0.000632
 +
 
 +
                DiscountS7_Rates(4) = 0.001581
 +
 
 +
                DiscountS7_Rates(5) = 0.003873
 +
 
 +
                DiscountS7_Rates(6) = 0.00767
 +
 
 +
                DiscountS7_Rates(7) = 0.01252
 +
 
 +
                DiscountS7_Rates(8) = 0.02561
 +
 
 +
                DiscountS7_Rates(9) = 0.10124
 +
 
 +
                DiscountS7_Rates(10) = 0.25
 +
 
 +
               
 +
 
 +
                Dim rank
 +
 
 +
                Dim Choice_Counts(10,3)
 +
 
 +
                Dim TopScores()
 +
 
 +
                Dim Inconsistencies(3) 'Indicator for inconsistent results
 +
 
 +
                Dim Delayed_Choice(10,3)
 +
 
 +
               
 +
 
 +
                ' Skip Block 7
 +
 
 +
                Dim s7_rank
 +
 
 +
                Dim s7_Choice_Counts(10,3)
 +
 
 +
                Dim s7_TopScores()
 +
 
 +
                Dim s7_Inconsistencies(3) 'Indicator for inconsistent results
 +
 
 +
                Dim s7_Delayed_Choice(10,3)
 +
 
 +
               
 +
 
 +
                strSQL = "SELECT * FROM " & TableName & " where [Subject]=" & SubjectID & " order by [Block]"
 +
 
 +
                Set ers = Server.CreateObject("ADODB.Recordset")
 +
 
 +
                ers.Open strSQL, DataConn, adOpenStatic
 +
 
 +
                if ers.eof or ers.recordcount <> 27 then
 +
 
 +
                                exit sub
 +
 
 +
                end if
 +
 
 +
               
 +
 
 +
                strSQL = "SELECT * FROM Qry_DDT_Trial7 where [Subject]=" & SubjectID
 +
 
 +
                Set ers2 = Server.CreateObject("ADODB.Recordset")
 +
 
 +
                ers2.Open strSQL, DataConn, adOpenStatic
 +
 
 +
                if not ers2.eof and ers2("Delay") <> 13 then
 +
 
 +
                                TypoS7 = "Y"
 +
 
 +
                else
 +
 
 +
                                TypoS7 = "N"
 +
 
 +
                end if
 +
 
 +
               
 +
 
 +
                do while not ers.eof
 +
 
 
         select case ucase(ers("R_Size"))
 
         select case ucase(ers("R_Size"))
Case "S"
+
 
 +
                                                Case "S"
 +
 
 
                 m = 1
 
                 m = 1
 +
 
             Case "M"
 
             Case "M"
 +
 
                 m = 2
 
                 m = 2
 +
 
             Case "L"
 
             Case "L"
 +
 
                 m = 3
 
                 m = 3
case else
+
 
m = ers("R_Size")
+
                                                case else
 +
 
 +
                                                                m = ers("R_Size")
 +
 
 
         End Select
 
         End Select
+
 
response.flush
+
                               
If ((right(ers("choice2"),4) = "days" and ers("ChoiceResp") = "{RIGHTARROW}") or (right(ers("choice2"),4) <> "days" and ers("ChoiceResp") = "{LEFTARROW}")) Then
+
 
             Delayed_Choice(ers("k_rank"), m) = True
+
                               
 +
 
 +
                                If (((right(ers("choice2"),4) = "days" or right(ers("choice2"),4) = "dias") and ers("ChoiceResp") = "{RIGHTARROW}") or ((right(ers("choice2"),4) <> "days" and right(ers("choice2"),4) <> "dias") and ers("ChoiceResp") = "{LEFTARROW}")) Then
 +
 
 +
             if (TypoS7 = "Y" and ers("Block") = 7) then
 +
 
 +
                                                                Delayed_Choice(6, m) = True
 +
 
 +
                                                else
 +
 
 +
                                                                Delayed_Choice(ers("k_rank"), m) = True
 +
 
 +
                                                end if
 +
 
 +
                                                if (ers("Block") <> 7) then
 +
 
 +
                                                                s7_Delayed_Choice(ers("k_rank"), m) = True
 +
 
 +
                                                end if
 +
 
 
         Else
 
         Else
             Delayed_Choice(ers("k_rank"), m) = False
+
 
 +
             if (TypoS7 = "Y" and ers("Block") = 7) then
 +
 
 +
                                                                Delayed_Choice(6, m) = False
 +
 
 +
                                                else
 +
 
 +
                                                                Delayed_Choice(ers("k_rank"), m) = False
 +
 
 +
                                                end if
 +
 
 +
                                                if (ers("Block") <> 7) then
 +
 
 +
                                                                s7_Delayed_Choice(ers("k_rank"), m) = False
 +
 
 +
                                                end if
 +
 
 
         End If
 
         End If
    ers.movenext
+
 
loop
+
                ers.movenext
 +
 
 +
                loop
 +
 
 
      
 
      
For m = 1 To 3
 
    aryScore(m) = 1
 
For i = 1 To 9
 
For a = 1 To 10
 
'Debug.Print "Trial_Data = " & Trial_Data(i, m) & " DiscountRate = " & Discount_Rates(a) & " DelayedChoice = " & Delayed_Choice(i, m)
 
If a <> 1 And Trial_Data(i, m) < Discount_Rates(a) And Delayed_Choice(i, m) = False Then
 
Choice_Counts(a, m) = Choice_Counts(a, m) + 1
 
            ElseIf a <> 10 And Trial_Data(i, m) > Discount_Rates(a) And Delayed_Choice(i, m) = True Then
 
                Choice_Counts(a, m) = Choice_Counts(a, m) + 1
 
            ElseIf a = 1 And Trial_Data(i, m) = Discount_Rates(a) And Delayed_Choice(i, m) = True Then
 
                Choice_Counts(1, m) = Choice_Counts(1, m) + 1
 
            ElseIf a = 10 And Trial_Data(i, m) = Discount_Rates(a) And Delayed_Choice(i, m) = False Then
 
              Choice_Counts(10, m) = Choice_Counts(10, m) + 1
 
End If
 
        Next
 
    Next
 
 
    ' Determine the most consistent choice
 
    Top_Choice = -1
 
    For i = 1 To 10
 
If Choice_Counts(i, m) > Top_Choice Then
 
Top_Choice = Choice_Counts(i, m)
 
end if
 
    Next
 
' debug.print "Top Choice = " & Top_Choice
 
 
    ' Determine all discount rates that are equally consistent (if more than one)
 
    ReDim TopScores(1)
 
    For i = 1 To 10
 
' debug.print "i = " & i
 
' debug.print "Choice_Counts(" & i & "," & m & ") = " & Choice_Counts(i,m)
 
        If Choice_Counts(i, m) = Top_Choice Then
 
' debug.print "TopScores contains " & ubound( TopScores ) & " items"
 
            If TopScores(1) > 0 Then
 
                ReDim Preserve TopScores(UBound(TopScores) + 1)
 
                TopScores(UBound(TopScores)) = i
 
            Else
 
                TopScores(1) = i
 
            End If
 
        End If
 
    Next
 
 
    ' Calculate the assigned discount rate
 
    If UBound(TopScores) > 1 Then
 
        For i = 1 To UBound(TopScores)
 
            aryScore(m) = aryScore(m) * CDbl(Discount_Rates(TopScores(i)))
 
        Next
 
        aryScore(m) = aryScore(m) ^ (1 / UBound(TopScores))
 
    Else
 
' debug.print TopScores(1)
 
aryScore(m) = Discount_Rates(TopScores(1))
 
    End If
 
   
 
    ' Check if the most common choice is not actually consistent (according to Kirby criteria)
 
    If Top_Choice < 7 Then Inconsistencies(m) = True
 
Next
 
 
    aryScore(4) = (aryScore(1) * aryScore(2) * aryScore(3)) ^ (1 / 3)
 
 
for i = 1 to 4
 
aryScore(i) = formatnumber(aryScore(i),6)
 
next
 
 
Dim Distribution
 
 
for i = 1 to 3
 
if (len(Inconsistencies(i))=0) then
 
aryScore(4+i)="N"
 
else
 
aryScore(4+i)="Y"
 
end if
 
next
 
kk = 8
 
' ===============================================================================================
 
' Mean RT
 
' ===============================================================================================
 
strSQL = "SELECT avg(cast(ChoiceRT as float))as MeanValue FROM " & TableName & " where [Subject]=" & SubjectID
 
Set ers = Server.CreateObject("ADODB.Recordset")
 
ers.Open strSQL, DataConn, adOpenStatic
 
TotalRec = ers.RecordCount
 
if ers.eof then
 
aryScore(kk) = null
 
else
 
aryScore(kk) = ers("MeanValue")
 
end if
 
kk = kk + 1
 
 
' ===============================================================================================
 
' Median RT
 
' ===============================================================================================
 
sSQL = "SELECT * FROM " & TableName & " where [Subject]=" & SubjectID & " and ChoiceRT is not null order by ChoiceRT"
 
aryScore(kk) = RunSQL_MEDIAN(sSQL,"ChoiceRT")
 
kk = kk + 1
 
 
' ===============================================================================================
 
' SD Reaction Time for 1 repeat
 
' ===============================================================================================
 
strSQL = "SELECT STDEV(ChoiceRT) as STDDEV FROM " & TableName & " where [Subject]=" & SubjectID
 
Set ers = Server.CreateObject("ADODB.Recordset")
 
ers.Open strSQL, DataConn, adOpenStatic
 
if ers.eof then
 
aryScore(kk) = Null
 
else
 
aryScore(kk) = ers("STDDEV")
 
end if
 
  
 +
                For m = 1 To 3                                    ' R_Size S M L
  
 +
                aryScore(m) = 1
  
------
+
                                For i = 1 To 9                      ' Block
 +
 
 +
                                                For a = 1 To 10
 +
 
 +
                                                                'Debug.Print "Trial_Data = " & Trial_Data(i, m) & " DiscountRate = " & Discount_Rates(a) & " DelayedChoice = " & Delayed_Choice(i, m)
 +
 
 +
                                                                if (m=1 and i=7 and TypoS7 = "Y") then
 +
 
 +
                                                                                If a <> 1 And TrialS7_Data(i, m) < DiscountS7_Rates(a) And Delayed_Choice(i, m) = False Then
 +
 
 +
                                                                                                Choice_Counts(a, m) = Choice_Counts(a, m) + 1
 +
 
 +
                                ElseIf a <> 10 And TrialS7_Data(i, m) > DiscountS7_Rates(a) And Delayed_Choice(i, m) = True Then
 +
 
 +
                                              Choice_Counts(a, m) = Choice_Counts(a, m) + 1
 +
 
 +
                                ElseIf a = 1 And TrialS7_Data(i, m) = DiscountS7_Rates(a) And Delayed_Choice(i, m) = True Then
 +
 
 +
                                                                                                Choice_Counts(1, m) = Choice_Counts(1, m) + 1
 +
 
 +
                                ElseIf a = 10 And TrialS7_Data(i, m) = DiscountS7_Rates(a) And Delayed_Choice(i, m) = False Then
 +
 
 +
                                                                                                Choice_Counts(10, m) = Choice_Counts(10, m) + 1
 +
 
 +
                                                                                End If
 +
 
 +
                                                                else
 +
 
 +
                                                                                If a <> 1 And Trial_Data(i, m) < Discount_Rates(a) And Delayed_Choice(i, m) = False Then
 +
 
 +
                                                                                                Choice_Counts(a, m) = Choice_Counts(a, m) + 1
 +
 
 +
                                ElseIf a <> 10 And Trial_Data(i, m) > Discount_Rates(a) And Delayed_Choice(i, m) = True Then
 +
 
 +
                                              Choice_Counts(a, m) = Choice_Counts(a, m) + 1
 +
 
 +
                                ElseIf a = 1 And Trial_Data(i, m) = Discount_Rates(a) And Delayed_Choice(i, m) = True Then
 +
 
 +
                                                                                                Choice_Counts(1, m) = Choice_Counts(1, m) + 1
 +
 
 +
                                ElseIf a = 10 And Trial_Data(i, m) = Discount_Rates(a) And Delayed_Choice(i, m) = False Then
 +
 
 +
                                                                                                Choice_Counts(10, m) = Choice_Counts(10, m) + 1
 +
 
 +
                                                                                End If
 +
 
 +
                                                                end if
 +
 
 +
                Next
 +
 
 +
                Next
 +
 
 +
                               
 +
 
 +
                ' Determine the most consistent choice
 +
 
 +
                Top_Choice = -1
 +
 
 +
                For i = 1 To 10
 +
 
 +
                                                If Choice_Counts(i, m) > Top_Choice Then
 +
 
 +
                                                                Top_Choice = Choice_Counts(i, m)
 +
 
 +
                                                end if
 +
 
 +
                Next
 +
 
 +
                                ' debug.print "Top Choice = " & Top_Choice
 +
 
 +
                               
 +
 
 +
                ' Determine all discount rates that are equally consistent (if more than one)
 +
 
 +
                ReDim TopScores(1)
 +
 
 +
                For i = 1 To 10
 +
 
 +
                                                ' debug.print "i = " & i
 +
 
 +
                                                ' debug.print "Choice_Counts(" & i & "," & m & ") = " & Choice_Counts(i,m)
 +
 
 +
                If Choice_Counts(i, m) = Top_Choice Then
 +
 
 +
                                                                ' debug.print "TopScores contains " & ubound( TopScores ) & " items"
 +
 
 +
                If TopScores(1) > 0 Then
 +
 
 +
                                ReDim Preserve TopScores(UBound(TopScores) + 1)
 +
 
 +
                                TopScores(UBound(TopScores)) = i
 +
 
 +
                Else
 +
 
 +
                                TopScores(1) = i
 +
 
 +
                End If
 +
 
 +
                End If
 +
 
 +
                Next
 +
 
 +
                               
 +
 
 +
                ' Calculate the assigned discount rate
 +
 
 +
                If UBound(TopScores) > 1 Then
 +
 
 +
                For i = 1 To UBound(TopScores)
 +
 
 +
                aryScore(m) = aryScore(m) * CDbl(Discount_Rates(TopScores(i)))
 +
 
 +
                Next
 +
 
 +
                aryScore(m) = aryScore(m) ^ (1 / UBound(TopScores))
 +
 
 +
                Else
 +
 
 +
                                                ' debug.print TopScores(1)
 +
 
 +
                                                aryScore(m) = Discount_Rates(TopScores(1))
 +
 
 +
                End If
 +
 
 +
               
 +
 
 +
                ' Check if the most common choice is not actually consistent (according to Kirby criteria)
 +
 
 +
                If Top_Choice < 7 Then Inconsistencies(m) = True
 +
 
 +
                Next
 +
 
 +
               
 +
 
 +
               
 +
 
 +
                ' =================================================
 +
 
 +
                ' Skip Block 7, Only Affect Small K Section (Skip S7; when new method adopt we may skip this section)
 +
 
 +
                ' =================================================
 +
 
 +
                For m = 1 To 1
 +
 
 +
                aryScore(4) = 1
 +
 
 +
                                For i = 1 To 9
 +
 
 +
                                                For a = 1 To 10
 +
 
 +
                                                                If a <> 1 And Trial_Data(i, m) < Discount_Rates(a) And s7_Delayed_Choice(i, m) = False Then
 +
 
 +
                                                                                s7_Choice_Counts(a, m) = s7_Choice_Counts(a, m) + 1
 +
 
 +
                ElseIf a <> 10 And Trial_Data(i, m) > Discount_Rates(a) And s7_Delayed_Choice(i, m) = True Then
 +
 
 +
                                s7_Choice_Counts(a, m) = s7_Choice_Counts(a, m) + 1
 +
 
 +
                ElseIf a = 1 And Trial_Data(i, m) = Discount_Rates(a) And s7_Delayed_Choice(i, m) = True Then
 +
 
 +
                  s7_Choice_Counts(1, m) = s7_Choice_Counts(1, m) + 1
 +
 
 +
                ElseIf a = 10 And Trial_Data(i, m) = Discount_Rates(a) And s7_Delayed_Choice(i, m) = False Then
 +
 
 +
                s7_Choice_Counts(10, m) = s7_Choice_Counts(10, m) + 1
 +
 
 +
                                                                End If
 +
 
 +
                Next
 +
 
 +
                Next
 +
 
 +
                               
 +
 
 +
                Top_Choice = -1
 +
 
 +
                For i = 1 To 10
 +
 
 +
                                                If s7_Choice_Counts(i, m) > Top_Choice Then
 +
 
 +
                                                                Top_Choice = s7_Choice_Counts(i, m)
 +
 
 +
                                                end if
 +
 
 +
                Next
 +
 
 +
                               
 +
 
 +
                ReDim TopScores(1)
 +
 
 +
                For i = 1 To 10
 +
 
 +
                If s7_Choice_Counts(i, m) = Top_Choice Then
 +
 
 +
                If TopScores(1) > 0 Then
 +
 
 +
                                ReDim Preserve TopScores(UBound(TopScores) + 1)
 +
 
 +
                                TopScores(UBound(TopScores)) = i
 +
 
 +
                Else
 +
 
 +
                                TopScores(1) = i
 +
 
 +
                End If
 +
 
 +
                End If
 +
 
 +
                Next
 +
 
 +
                               
 +
 
 +
                If UBound(TopScores) > 1 Then
 +
 
 +
                For i = 1 To UBound(TopScores)
 +
 
 +
                aryScore(4) = aryScore(4) * CDbl(Discount_Rates(TopScores(i)))
 +
 
 +
                Next
 +
 
 +
                aryScore(4) = aryScore(4) ^ (1 / UBound(TopScores))
 +
 
 +
                Else
 +
 
 +
                                                aryScore(4) = Discount_Rates(TopScores(1))
 +
 
 +
                End If
 +
 
 +
               
 +
 
 +
                If Top_Choice < 6 Then s7_Inconsistencies(m) = True
 +
 
 +
                Next
 +
 
 +
                ' ==================================
 +
 
 +
                ' End Skip Block 7 Small K Section
 +
 
 +
                ' ==================================
 +
 
 +
               
 +
 
 +
                ' Total K WITH Block 7
 +
 
 +
    aryScore(5) = (aryScore(1) * aryScore(2) * aryScore(3)) ^ (1 / 3)
 +
 
 +
                ' Total K WITHOUT Block 7
 +
 
 +
    aryScore(6) = (aryScore(4) * aryScore(2) * aryScore(3)) ^ (1 / 3)
 +
 
 +
               
 +
 
 +
                for i = 1 to 6
 +
 
 +
                                aryScore(i) = formatnumber(aryScore(i),6)
 +
 
 +
                next
 +
 
 +
               
 +
 
 +
                ' Log Small, Medium, Large, Totak K vlaues (for Score 7 - 12)
 +
 
 +
                k = 6
 +
 
 +
                for i = 1 to 6
 +
 
 +
                                aryScore(k+i) = formatnumber(log(aryScore(i)),6)
 +
 
 +
                next
 +
 
 +
               
 +
 
 +
               
 +
 
 +
                Dim Distribution
 +
 
 +
               
 +
 
 +
                ' For Inconsistencies Score 13 to 15
 +
 
 +
                for i = 1 to 3
 +
 
 +
                                if (len(Inconsistencies(i))=0) then
 +
 
 +
                                                aryScore(12+i)="N"
 +
 
 +
                                else
 +
 
 +
                                                aryScore(12+i)="Y"
 +
 
 +
                                end if
 +
 
 +
                next
 +
 
 +
                ' For Skip Block 7 Inconsistencies Score 16 to 16
 +
 
 +
                for i = 1 to 1
 +
 
 +
                                if (len(s7_Inconsistencies(i))=0) then
 +
 
 +
                                                aryScore(15+i)="N"
 +
 
 +
                                else
 +
 
 +
                                                aryScore(15+i)="Y"
 +
 
 +
                                end if
 +
 
 +
                next
 +
 
 +
               
 +
 
 +
               
 +
 
 +
                kk = 17
 +
 
 +
                ' ===============================================================================================
 +
 
 +
                ' Mean RT
 +
 
 +
                ' ===============================================================================================
 +
 
 +
                strSQL = "SELECT avg(cast(ChoiceRT as float))as MeanValue FROM " & TableName & " where [Subject]=" & SubjectID
 +
 
 +
                Set ers = Server.CreateObject("ADODB.Recordset")
 +
 
 +
                ers.Open strSQL, DataConn, adOpenStatic
 +
 
 +
                TotalRec = ers.RecordCount
 +
 
 +
                if ers.eof then
 +
 
 +
                                aryScore(kk) = null
 +
 
 +
                else
 +
 
 +
                                aryScore(kk) = ers("MeanValue")
 +
 
 +
                end if
 +
 
 +
                kk = kk + 1
 +
 
 +
               
 +
 
 +
                ' ===============================================================================================
 +
 
 +
                ' Median RT
 +
 
 +
                ' ===============================================================================================
 +
 
 +
                sSQL = "SELECT * FROM " & TableName & " where [Subject]=" & SubjectID & " and ChoiceRT is not null order by ChoiceRT"
 +
 
 +
                aryScore(kk) = RunSQL_MEDIAN(sSQL,"ChoiceRT")
 +
 
 +
                kk = kk + 1
 +
 
 +
               
 +
 
 +
                ' ===============================================================================================
 +
 
 +
                ' SD Reaction Time for 1 repeat
 +
 
 +
                ' ===============================================================================================
 +
 
 +
                strSQL = "SELECT STDEV(ChoiceRT) as STDDEV FROM " & TableName & " where [Subject]=" & SubjectID
 +
 
 +
                Set ers = Server.CreateObject("ADODB.Recordset")
 +
 
 +
                ers.Open strSQL, DataConn, adOpenStatic
 +
 
 +
                if ers.eof then
 +
 
 +
                                aryScore(kk) = Null
 +
 
 +
                else
 +
 
 +
                                aryScore(kk) = ers("STDDEV")
 +
 
 +
                end if
  
 
=== History of Checking Scoring and Program Changes ===
 
=== History of Checking Scoring and Program Changes ===
Line 328: Line 779:
 
* In July 2009 Andy Dean checked the results of the Delay Discounting Task and found them to be accurate.
 
* In July 2009 Andy Dean checked the results of the Delay Discounting Task and found them to be accurate.
 
* In July 2011 Andy Dean found a typo on trial number 7 of the task.  This typo only occurs for participants who received one of the first versions of the DDT program (n = 48). The delayed option on the trial should read “$35 in 13 days”, but instead it reads “$35 in 136 days”.  Because of this error, the indifference k value for this item is 0.0098, rather than the intended 0.10.  This item is part of the calculation of the small magnitude k value.  Andy Dean worked with Stone Shih (Jan. 2012) to reprogram the scoring method for the small magnitude so that, when there is a typo, the indifference k value for the item is adjusted accordingly, and incorporated into the Kirby scoring method.  Of the 48 participants with the typo, the revision of scoring changed the small k value for only 4 participants.  Thus, the error produced by the typo is minimal.  Also, the revision of scoring for the typo should not adversely affect the scoring of inconsistencies. However, for the purpose of publications the data with the typo can be excluded through use of the DDT_ITEMS7_TYPO variable (typo = 1).
 
* In July 2011 Andy Dean found a typo on trial number 7 of the task.  This typo only occurs for participants who received one of the first versions of the DDT program (n = 48). The delayed option on the trial should read “$35 in 13 days”, but instead it reads “$35 in 136 days”.  Because of this error, the indifference k value for this item is 0.0098, rather than the intended 0.10.  This item is part of the calculation of the small magnitude k value.  Andy Dean worked with Stone Shih (Jan. 2012) to reprogram the scoring method for the small magnitude so that, when there is a typo, the indifference k value for the item is adjusted accordingly, and incorporated into the Kirby scoring method.  Of the 48 participants with the typo, the revision of scoring changed the small k value for only 4 participants.  Thus, the error produced by the typo is minimal.  Also, the revision of scoring for the typo should not adversely affect the scoring of inconsistencies. However, for the purpose of publications the data with the typo can be excluded through use of the DDT_ITEMS7_TYPO variable (typo = 1).
* In May 2012 Andy Dean conducted a final check of the DDT data and produced the figures and tables displayed below. No errors were found.
+
* In May 2012 Andy Dean found that the number of inconsistencies (in all magnitudes) produced by participants was significantly less than in previous examinations of the data.  Andy worked with Stone and found that the OLD coding was incorrect because it did not take into account the use of Spanish language.  Therefore, the current scoring of inconsistencies is correct.
 +
*In May and June 2012 Andy Dean produced the final tables and figures below. No errors were found.
  
 
=== Data Distributions ===
 
=== Data Distributions ===
Line 385: Line 837:
 
[[File:AgeDDT.png]]
 
[[File:AgeDDT.png]]
  
=====No relation with gender (p = .15)=====
+
=====No relation with gender (p = .77)=====
  
[[File:Gender.png]]
+
[[File:GenderDDT.png]]
  
 
=====Negative relationship between education and delay discounting=====
 
=====Negative relationship between education and delay discounting=====
  
[[File:Education.png]]
+
[[File:EduDDT.png]]
  
 +
=====Relationship between ethnicity and delay discounting (p = .000)=====
 +
 +
[[File:EthnicityDDT.png]]
  
 
=== References ===
 
=== References ===
Line 404: Line 859:
 
Reynolds B,  Schiffbauer R (2004) Measuring state changes in human delay discounting:
 
Reynolds B,  Schiffbauer R (2004) Measuring state changes in human delay discounting:
 
An experiential discounting task. Behavioural Processes 67: 343-356.
 
An experiential discounting task. Behavioural Processes 67: 343-356.
 +
 +
go back to [[HTAC]]

Latest revision as of 12:25, 21 June 2012

go back to HTAC

Basic Task Description

Delay discounting is the tendency to reduce, or discount, the perceived value of a reward as a function of the amount of time delayed before receiving the reward. The more time elapsed before receiving a reward, the lower its present value with respect to current alternatives. For example, most people would ascribe a higher perceived value to $5 which could be received immediately relative to $5 received in one year. The discount rate describes the steepness of the reduction in the present value of a reward with increases in its delay. The higher the rate of delay discounting, the less relative value which is assigned to a reward as its availability is delayed. Although different measures of delay discounting have been developed (e.g., Petry and Casarella, 1999; Kirby, Petry, and Bickel, 1999), some of which involve actually experiencing delays before receiving rewards (Reynolds and Schiffbauer, 2004), we used a questionnaire-based measure which requires the examinee to determine his or her preference for various hypothetical monetary rewards available at different timeframes (Kirby, Petry, and Bickel, 1999). By evaluating an examinee’s preferences across the task, a discount rate can be estimated. The discount rate is referred to as the individual’s k value. K values have been shown to vary across individuals and have been associated with self-reported impulsivity and drug use (Kirby, Petry, and Bickel, 1999; Kirby and Petry, 2004; Audrain-McGovern et al., 2009).

Task Procedure

Our version of the Kirby et al. (1999) delay discounting questionnaire was programmed in E-Prime 2.0. Participants must indicate their preference for one of two hypothetical options across 27 trials: one option consists of receiving an amount of money immediately (e.g., $24 today), and the other option consists of receiving a larger amount of money at a later point in time (e.g., $35 in 29 days). The discrepancy between the money amounts ($25 to $85) and the duration of the delay period (7 to 186 days) is varied across trials. Sampling of different monetary magnitudes and delay periods allows for calculation of the discounting rate (k value) most characteristic of an individual’s responding (see the Dependent Variables section for discussion of k value calculation).

The task begins with a title screen (displaying the acronym DDT in yellow on a black background in Arial size 45 font) which is advanced by a left mouse-click from the examiner. The next screen displays the instructions for the task as follows:

  • We would like you to imagine that someone is willing to give you different amounts of money. You could receive some of the amounts of money today, while other amounts you could only receive at a later point in time.
  • We would like you to make choices about different money options. Please respond as if the choices involved real money.
  • If you would prefer the money option on the LEFT, please press the LEFT key.
  • If you would prefer the money option on the RIGHT, please press the RIGHT key.
  • There are no right or wrong answers on this test. Just pick the option you would prefer if the money were real.
  • Place your hand on the table with your fingers extended and resting comfortably on the LEFT and RIGHT keys.


Following the instructions, the examinee is presented with the first trial of the task. At the top of each trial is a prompt which says “Would you prefer to receive:” (yellow Arial 16 font), followed by two choices presented below, one on the right, and one on the left (in yellow Arial size 16 font on a black background). One choice is the immediate option, and the other is the delayed option. Using the left and right keys, the participant selects the option he or she prefers (the selected option briefly [1 sec] turns green while the nonselected option turns white), and then the next trial is immediately presented on a subsequent screen. The order of the trials presented is fixed and is identical to that used by Kirby, Petry, and Bickel (1999, see Order on p. 81). The side of the screen on which the immediate and delayed option is presented varies by trial: trials 1-5, 9-14, 23, 24, 26, and 27 have the immediate option presented on the left side of the screen and the delayed option on the right side of the screen, and trials 6-8, 15-22, and 25 have the delayed option presented on the left side of the screen and the immediate option on the right side of the screen. The task concludes after 27 trials and ends with a screen which says “Thank you for participating” in yellow Arial size 16 font. Participants are not provided any feedback regarding their selections during the task, nor are they given any actual monetary rewards for their performance. For discussion of task scoring, please see the Dependent Variables section.

Task Structure Detail

  • Task Structure
    • The Delay Discounting Task has one instructional screen, followed by 27 trials.
      • Instructional screen. Advanced with a right mouse click from the examiner.
      • Experimental trials 27 trials).
        • Presentation of immediate and delayed options (no time limit on either side of screen.
          • Participant selects preferred option, and the selected option briefly turns green for 1 sec and the nonselected option turns white, and then the next trial is immediately presented.
      • End. Thank you screen presented.
  • Timing
      • Instruction screen is static until advanced by examiner with a right mouse click.
      • Presentation of trial with immediate and delayed options (no time limit).
      • Selected option turns green for 1 sec, and then immediately advances to next trial.
      • The ending thank you screen is static until advanced by the examiner with right mouse click.
  • Stimulus Characteristics
    • sensory modality: Visual text. All screens have a black background. Instructions and trials are presented in yellow Arial 16 point font. Trial text briefly turns green to indicate when a particular option is selected (and the nonselected option turns white).
    • functional modality: Visual linguistic (understanding of text).
    • presentation modality: computer display, no audio, directions are assisted by examiner.
  • Response Characteristics
    • responses required: left or right key press to select the right or left option on the screen.
      • effector modality: Manual button press.
      • functional modality: Manual button press.
    • response options (e.g., yes/no, go/no-go, forced choice, multiple choice [specify n of options], free response): multiple choice between two options.
    • response collection (e.g., examiner notes, keyboard, keypad, mouse, voice key, button press): Button press and recording of responses in Eprime 2.0.

Task Schematic

Example appearance of Delay Discounting trial.

DDTslide2.PNG

Task Parameters Table

Taskparameterstable.png

Stimuli

Stimuli consist of visual text in a two-choice multiple choice format. Trials use yellow Arial size 16 text. This text briefly turns green to indicate when a particular option is selected.

Dependent Variables

The primary dependent variable for the Delay Discounting task is the k value. The k value is an estimate of the degree to which future rewards are discounted relative to immediate rewards, and is defined by the following hyperbolic statistical function (Kirby, Petry and Bickel, 1999) :

V =A / (1 + kD)


Where V is the present value of the delayed reward A at delay D, and k is a free parameter that determines the discount rate. If an individual were indifferent between the immediate and delayed reward on any given trial, V in the above equation can be assumed to be the smaller, immediate option, and k would thus represent a discounting rate which is indifferent between the immediate and delayed reward on that trial. Thus, each trial on the task can be assigned a k value which represents the point at which an individual would be indifferent between the immediate and delayed options. The indifference k values for the trials on the task have one of the following k values:

  • 0.00016
  • 0.00040
  • 0.0010
  • 0.0025
  • 0.0060
  • 0.016
  • 0.041
  • 0.10
  • 0.25


Each of the above indifference k values is represented by 3 items on the task (3 items by 9 indifference k values = 27 total items). One of the 3 items for each k value uses small sums of money ($25 to $35), one uses medium sums of money ($50 to $60), and one uses large sums of money ($75 to $85). Different magnitudes of reward were used because discount rates typically decrease as the magnitude of rewards increase (Kirby et al., 1999).

Now, although the indifference k value for each item is known, the participant’s actual k value when responding to any individual item is NOT known. When responding to the trials, participants indicate their preference for either the immediate or delayed option on any given trial. If they select the immediate option, their actual k value can be assumed to be higher than the indifference k for that item; if they select the delayed option, their actual k value can be assumed to be lower than the indifference k for that item. In order to estimate the individual’s actual k value, the participant’s responding across trials is mapped onto a range of possible k values. This range consists of the highest (.25) and lowest (.00016) possible k values described above, with intermediate k values which consist of the geometric mean between the adjacent indifference k values of the list above (e.g., in the preceding list, 0.00016 was followed by 0.00040. The geometric mean of these values is 0.000253, which is shown below). The geometric mean is used rather than the arithmetic mean to avoid underweighting the smaller of the two values. I will call this range of k values the “placeholder” k values, and the placeholder range is as follows:

  • 0.00016
  • 0.000253
  • 0.000632
  • 0.001581
  • 0.003873
  • 0.009798
  • 0.025612
  • 0.064031
  • 0.158114
  • 0.25

Now, for each item on the task, the participant either chooses the immediate or the delayed option. If the immediate option was chosen, all the placeholder k values above the indifference k value of the item are considered to be consistent with that selection (all these placeholders get value of 1), while all the k values below the indifference k value of the item are considered to be inconsistent with that selection (all these placeholders get a value of 0). Conversely, if the delayed option was chosen, all the placeholder k values below the indifference k value of the item are considered to be consistent with that selection (all these placeholders get value of 1), while all the placeholder k values above the indifference k value of the item are considered to be inconsistent with that selection (all these placeholders get a value of 0). So for each item on the measure, the placeholder k values shown above receive a score of 0 or 1 depending on how the participant responds. This process is achieved with a looping function in the scoring program.

In order to determine the participant’s final actual k value, the tally of the placeholder k values is evaluated to determine which placeholder value had the most selections across the task which were consistent with it. Because of possible reward magnitude effects, this process is done in the small, medium, and large sums of money separately. When two or more placeholder values were equally consistent in a given magnitude, the geometric mean of the placeholder values was taken to provide the final k value. Lastly, to get the total k value for the participant, the geometric mean of the k values for the small, medium, and large magnitudes was obtained. Because k value data are typically skewed, the variables are typically normalized with the natural log function prior to implementation in research (Kirby et al., 1999).

Before using the obtained k values, it is important to determine whether the participant responded consistently enough across trials for the derived k value to be meaningful. Kirby and Petry (2004) defined inconsistent responding as the selection of 3 or more response options within a given magnitude that are inconsistent with the assigned k value. Variables for inconsistent responding have been created for each reward magnitude, and it is recommended that the Delay Discounting data not be used for any subject with inconsistent responding in any magnitude.

In addition to the k values for the small, medium, large, and total sums of money, the mean, median and standard deviation of reaction times are derived for all button presses during the task. These reaction time variables are exploratory.

Please note that there was a typo on item 7 for 48 of the LA2K subjects (see History of Checking Scoring section for details). The calculation of k values adjusts for this typo, but the data can be excluded for those participants if preferred.

Table of all available variables

VariableTable.PNG

Cleaning Rules

The algorithm to score the DDT does not work if the task was not completed in its entirety, so all available data should be comprised of complete administrations. The primary consideration in cleaning the data lies in checking the INCONSISTENCY variables for each money magnitude. We recommend excluding all subjects who have an inconsistency in ANY reward magnitude; one or more inconsistencies suggest that the Kirby hyperbolic function does not fit the data accurately.

Because there is a typo on item number 7 for 48 of the LA2K subjects, data from these individuals can be excluded through the DDT_ITEMS7_TYPO variable (typo = 1). However, the scoring algorithm adjusts for the typo, and only 4 of the 48 subjects had their small k value altered with the adjusted scoring (vs. the original scoring). Thus, the impact of the typo is likely to be minimal.

In addition to excluding participants with inconsistent responding, researchers can consider excluding participants who always selected the delayed option throughout the task (DDT_TOTAL_K = .00016), or those who always selected the immediate option (DDT_TOTAL_K = .25).

Given the skewness of the data, we generally recommend using the logged, versus the raw, data.

Code/Algorithms

The following is a DDT scoring script in Visual Basic language. This script was provided by Stone Shih, and is based on a script developed by Cody Ashe-McNalley, Andy Dean, and John Monterosso.

' Modification based on Cody Ashe-McNalley 11/12/08

               dim slots(9), Trial_Data(9,3), TrialS7_Data(9,1), Discount_Rates(10), DiscountS7_Rates(10)
               Trial_Data(1, 1) = 0.00016
               Trial_Data(2, 1) = 0.0004
               Trial_Data(3, 1) = 0.001
               Trial_Data(4, 1) = 0.0025
               Trial_Data(5, 1) = 0.006
               Trial_Data(6, 1) = 0.016
               Trial_Data(7, 1) = 0.041
               Trial_Data(8, 1) = 0.1
               Trial_Data(9, 1) = 0.25


               TrialS7_Data(1, 1) = 0.00016
               TrialS7_Data(2, 1) = 0.0004
               TrialS7_Data(3, 1) = 0.001
               TrialS7_Data(4, 1) = 0.0025
               TrialS7_Data(5, 1) = 0.006
               TrialS7_Data(6, 1) = 0.0098           '0.0098 (new S7 value)
               TrialS7_Data(7, 1) = 0.016
               TrialS7_Data(8, 1) = 0.041
               TrialS7_Data(9, 1) = 0.25


               Trial_Data(1, 2) = 0.00016
               Trial_Data(2, 2) = 0.0004
               Trial_Data(3, 2) = 0.001
               Trial_Data(4, 2) = 0.0025
               Trial_Data(5, 2) = 0.006
               Trial_Data(6, 2) = 0.016
               Trial_Data(7, 2) = 0.041
               Trial_Data(8, 2) = 0.1
               Trial_Data(9, 2) = 0.25


               Trial_Data(1, 3) = 0.00016
               Trial_Data(2, 3) = 0.0004
               Trial_Data(3, 3) = 0.001
               Trial_Data(4, 3) = 0.0025
               Trial_Data(5, 3) = 0.006
               Trial_Data(6, 3) = 0.016
               Trial_Data(7, 3) = 0.041
               Trial_Data(8, 3) = 0.1
               Trial_Data(9, 3) = 0.25


               ' These values are the endpoints and geometric means of the k indifference values
               Discount_Rates(1) = 0.00016
               Discount_Rates(2) = 0.000253
               Discount_Rates(3) = 0.000632
               Discount_Rates(4) = 0.001581
               Discount_Rates(5) = 0.003873
               Discount_Rates(6) = 0.009798
               Discount_Rates(7) = 0.025612
               Discount_Rates(8) = 0.064031
               Discount_Rates(9) = 0.158114
               Discount_Rates(10) = 0.25


               ' These values are the endpoints and geometric means of the k indifference values
               DiscountS7_Rates(1) = 0.00016
               DiscountS7_Rates(2) = 0.000253
               DiscountS7_Rates(3) = 0.000632
               DiscountS7_Rates(4) = 0.001581
               DiscountS7_Rates(5) = 0.003873
               DiscountS7_Rates(6) = 0.00767
               DiscountS7_Rates(7) = 0.01252
               DiscountS7_Rates(8) = 0.02561
               DiscountS7_Rates(9) = 0.10124
               DiscountS7_Rates(10) = 0.25


               Dim rank
               Dim Choice_Counts(10,3)
               Dim TopScores()
               Dim Inconsistencies(3) 'Indicator for inconsistent results
               Dim Delayed_Choice(10,3)


               ' Skip Block 7
               Dim s7_rank
               Dim s7_Choice_Counts(10,3)
               Dim s7_TopScores()
               Dim s7_Inconsistencies(3) 'Indicator for inconsistent results
               Dim s7_Delayed_Choice(10,3)


               strSQL = "SELECT * FROM " & TableName & " where [Subject]=" & SubjectID & " order by [Block]"
               Set ers = Server.CreateObject("ADODB.Recordset")
               ers.Open strSQL, DataConn, adOpenStatic
               if ers.eof or ers.recordcount <> 27 then
                               exit sub
               end if


               strSQL = "SELECT * FROM Qry_DDT_Trial7 where [Subject]=" & SubjectID
               Set ers2 = Server.CreateObject("ADODB.Recordset")
               ers2.Open strSQL, DataConn, adOpenStatic
               if not ers2.eof and ers2("Delay") <> 13 then
                               TypoS7 = "Y"
               else
                               TypoS7 = "N"
               end if


               do while not ers.eof
       select case ucase(ers("R_Size"))
                                               Case "S"
               m = 1
           Case "M"
               m = 2
           Case "L"
               m = 3
                                               case else
                                                               m = ers("R_Size")
       End Select



                               If (((right(ers("choice2"),4) = "days" or right(ers("choice2"),4) = "dias") and ers("ChoiceResp") = "{RIGHTARROW}") or ((right(ers("choice2"),4) <> "days" and right(ers("choice2"),4) <> "dias") and ers("ChoiceResp") = "{LEFTARROW}")) Then
           if (TypoS7 = "Y" and ers("Block") = 7) then
                                                               Delayed_Choice(6, m) = True
                                               else
                                                               Delayed_Choice(ers("k_rank"), m) = True
                                               end if
                                               if (ers("Block") <> 7) then
                                                               s7_Delayed_Choice(ers("k_rank"), m) = True
                                               end if
       Else
           if (TypoS7 = "Y" and ers("Block") = 7) then
                                                               Delayed_Choice(6, m) = False
                                               else
                                                               Delayed_Choice(ers("k_rank"), m) = False
                                               end if
                                               if (ers("Block") <> 7) then
                                                               s7_Delayed_Choice(ers("k_rank"), m) = False
                                               end if
       End If
               ers.movenext
               loop


               For m = 1 To 3                                    ' R_Size S M L
               aryScore(m) = 1
                               For i = 1 To 9                       ' Block
                                               For a = 1 To 10
                                                               'Debug.Print "Trial_Data = " & Trial_Data(i, m) & " DiscountRate = " & Discount_Rates(a) & " DelayedChoice = " & Delayed_Choice(i, m)
                                                               if (m=1 and i=7 and TypoS7 = "Y") then
                                                                               If a <> 1 And TrialS7_Data(i, m) < DiscountS7_Rates(a) And Delayed_Choice(i, m) = False Then
                                                                                               Choice_Counts(a, m) = Choice_Counts(a, m) + 1
                               ElseIf a <> 10 And TrialS7_Data(i, m) > DiscountS7_Rates(a) And Delayed_Choice(i, m) = True Then
                                              Choice_Counts(a, m) = Choice_Counts(a, m) + 1
                               ElseIf a = 1 And TrialS7_Data(i, m) = DiscountS7_Rates(a) And Delayed_Choice(i, m) = True Then
                                                                                               Choice_Counts(1, m) = Choice_Counts(1, m) + 1
                               ElseIf a = 10 And TrialS7_Data(i, m) = DiscountS7_Rates(a) And Delayed_Choice(i, m) = False Then
                                                                                               Choice_Counts(10, m) = Choice_Counts(10, m) + 1
                                                                               End If
                                                               else
                                                                               If a <> 1 And Trial_Data(i, m) < Discount_Rates(a) And Delayed_Choice(i, m) = False Then
                                                                                               Choice_Counts(a, m) = Choice_Counts(a, m) + 1
                               ElseIf a <> 10 And Trial_Data(i, m) > Discount_Rates(a) And Delayed_Choice(i, m) = True Then
                                              Choice_Counts(a, m) = Choice_Counts(a, m) + 1
                               ElseIf a = 1 And Trial_Data(i, m) = Discount_Rates(a) And Delayed_Choice(i, m) = True Then
                                                                                               Choice_Counts(1, m) = Choice_Counts(1, m) + 1
                               ElseIf a = 10 And Trial_Data(i, m) = Discount_Rates(a) And Delayed_Choice(i, m) = False Then
                                                                                               Choice_Counts(10, m) = Choice_Counts(10, m) + 1
                                                                               End If
                                                               end if
               Next
               Next


               ' Determine the most consistent choice
               Top_Choice = -1
               For i = 1 To 10
                                               If Choice_Counts(i, m) > Top_Choice Then
                                                               Top_Choice = Choice_Counts(i, m)
                                               end if
               Next
                               ' debug.print "Top Choice = " & Top_Choice


               ' Determine all discount rates that are equally consistent (if more than one)
               ReDim TopScores(1)
               For i = 1 To 10
                                               ' debug.print "i = " & i
                                               ' debug.print "Choice_Counts(" & i & "," & m & ") = " & Choice_Counts(i,m)
               If Choice_Counts(i, m) = Top_Choice Then
                                                               ' debug.print "TopScores contains " & ubound( TopScores ) & " items"
               If TopScores(1) > 0 Then
                               ReDim Preserve TopScores(UBound(TopScores) + 1)
                               TopScores(UBound(TopScores)) = i
               Else
                               TopScores(1) = i
               End If
               End If
               Next


               ' Calculate the assigned discount rate
               If UBound(TopScores) > 1 Then
               For i = 1 To UBound(TopScores)
               aryScore(m) = aryScore(m) * CDbl(Discount_Rates(TopScores(i)))
               Next
               aryScore(m) = aryScore(m) ^ (1 / UBound(TopScores))
               Else
                                               ' debug.print TopScores(1)
                                               aryScore(m) = Discount_Rates(TopScores(1))
               End If


               ' Check if the most common choice is not actually consistent (according to Kirby criteria)
               If Top_Choice < 7 Then Inconsistencies(m) = True
               Next



               ' =================================================
               ' Skip Block 7, Only Affect Small K Section (Skip S7; when new method adopt we may skip this section)
               ' =================================================
               For m = 1 To 1
               aryScore(4) = 1
                               For i = 1 To 9
                                               For a = 1 To 10
                                                               If a <> 1 And Trial_Data(i, m) < Discount_Rates(a) And s7_Delayed_Choice(i, m) = False Then
                                                                               s7_Choice_Counts(a, m) = s7_Choice_Counts(a, m) + 1
               ElseIf a <> 10 And Trial_Data(i, m) > Discount_Rates(a) And s7_Delayed_Choice(i, m) = True Then
                               s7_Choice_Counts(a, m) = s7_Choice_Counts(a, m) + 1
               ElseIf a = 1 And Trial_Data(i, m) = Discount_Rates(a) And s7_Delayed_Choice(i, m) = True Then
                 s7_Choice_Counts(1, m) = s7_Choice_Counts(1, m) + 1
               ElseIf a = 10 And Trial_Data(i, m) = Discount_Rates(a) And s7_Delayed_Choice(i, m) = False Then
               s7_Choice_Counts(10, m) = s7_Choice_Counts(10, m) + 1
                                                               End If
               Next
               Next


               Top_Choice = -1
               For i = 1 To 10
                                               If s7_Choice_Counts(i, m) > Top_Choice Then
                                                               Top_Choice = s7_Choice_Counts(i, m)
                                               end if
               Next


               ReDim TopScores(1)
               For i = 1 To 10
               If s7_Choice_Counts(i, m) = Top_Choice Then
               If TopScores(1) > 0 Then
                               ReDim Preserve TopScores(UBound(TopScores) + 1)
                               TopScores(UBound(TopScores)) = i
               Else
                               TopScores(1) = i
               End If
               End If
               Next


               If UBound(TopScores) > 1 Then
               For i = 1 To UBound(TopScores)
               aryScore(4) = aryScore(4) * CDbl(Discount_Rates(TopScores(i)))
               Next
               aryScore(4) = aryScore(4) ^ (1 / UBound(TopScores))
               Else
                                               aryScore(4) = Discount_Rates(TopScores(1))
               End If


               If Top_Choice < 6 Then s7_Inconsistencies(m) = True
               Next
               ' ==================================
               ' End Skip Block 7 Small K Section
               ' ==================================


               ' Total K WITH Block 7
   aryScore(5) = (aryScore(1) * aryScore(2) * aryScore(3)) ^ (1 / 3)
               ' Total K WITHOUT Block 7
   aryScore(6) = (aryScore(4) * aryScore(2) * aryScore(3)) ^ (1 / 3)


               for i = 1 to 6
                               aryScore(i) = formatnumber(aryScore(i),6)
               next


               ' Log Small, Medium, Large, Totak K vlaues (for Score 7 - 12)
               k = 6
               for i = 1 to 6
                               aryScore(k+i) = formatnumber(log(aryScore(i)),6)
               next



               Dim Distribution


               ' For Inconsistencies Score 13 to 15
               for i = 1 to 3
                               if (len(Inconsistencies(i))=0) then
                                               aryScore(12+i)="N"
                               else
                                               aryScore(12+i)="Y"
                               end if
               next
               ' For Skip Block 7 Inconsistencies Score 16 to 16
               for i = 1 to 1
                               if (len(s7_Inconsistencies(i))=0) then
                                               aryScore(15+i)="N"
                               else
                                               aryScore(15+i)="Y"
                               end if
               next



               kk = 17
               ' ===============================================================================================
               ' Mean RT
               ' ===============================================================================================
               strSQL = "SELECT avg(cast(ChoiceRT as float))as MeanValue FROM " & TableName & " where [Subject]=" & SubjectID
               Set ers = Server.CreateObject("ADODB.Recordset")
               ers.Open strSQL, DataConn, adOpenStatic
               TotalRec = ers.RecordCount
               if ers.eof then
                               aryScore(kk) = null
               else
                               aryScore(kk) = ers("MeanValue")
               end if
               kk = kk + 1


               ' ===============================================================================================
               ' Median RT
               ' ===============================================================================================
               sSQL = "SELECT * FROM " & TableName & " where [Subject]=" & SubjectID & " and ChoiceRT is not null order by ChoiceRT"
               aryScore(kk) = RunSQL_MEDIAN(sSQL,"ChoiceRT")
               kk = kk + 1


               ' ===============================================================================================
               ' SD Reaction Time for 1 repeat
               ' ===============================================================================================
               strSQL = "SELECT STDEV(ChoiceRT) as STDDEV FROM " & TableName & " where [Subject]=" & SubjectID
               Set ers = Server.CreateObject("ADODB.Recordset")
               ers.Open strSQL, DataConn, adOpenStatic
               if ers.eof then
                               aryScore(kk) = Null
               else
                               aryScore(kk) = ers("STDDEV")
               end if

History of Checking Scoring and Program Changes

  • Before November 2009, the Delay Discounting Task required that the participant hit the left or right key twice to confirm the selection on any given trial (the first entry highlighted the option, and the second entry confirmed the selection). Some time slightly before November 2008 the task was changed by Bob Bilder and Fred Sabb so that the participant did not need to hit the left or right key twice to confirm their selection. Only one key press is now required for each trial.
  • In November 2008 Andy Dean checked the Delay Discounting Program and found an error. The variable named “DelayedChoice” within the eprime program is incorrect after item 19 (i.e., the option designated as the delayed choice was in fact the immediate choice) for some versions of the program. The scoring subsequently used to extract the k values was altered so that the DelayedChoice variable was no longer used. This error did not affect the running of the task, nor the accuracy of scoring after the alteration was made.
  • In July 2009 Andy Dean checked the results of the Delay Discounting Task and found them to be accurate.
  • In July 2011 Andy Dean found a typo on trial number 7 of the task. This typo only occurs for participants who received one of the first versions of the DDT program (n = 48). The delayed option on the trial should read “$35 in 13 days”, but instead it reads “$35 in 136 days”. Because of this error, the indifference k value for this item is 0.0098, rather than the intended 0.10. This item is part of the calculation of the small magnitude k value. Andy Dean worked with Stone Shih (Jan. 2012) to reprogram the scoring method for the small magnitude so that, when there is a typo, the indifference k value for the item is adjusted accordingly, and incorporated into the Kirby scoring method. Of the 48 participants with the typo, the revision of scoring changed the small k value for only 4 participants. Thus, the error produced by the typo is minimal. Also, the revision of scoring for the typo should not adversely affect the scoring of inconsistencies. However, for the purpose of publications the data with the typo can be excluded through use of the DDT_ITEMS7_TYPO variable (typo = 1).
  • In May 2012 Andy Dean found that the number of inconsistencies (in all magnitudes) produced by participants was significantly less than in previous examinations of the data. Andy worked with Stone and found that the OLD coding was incorrect because it did not take into account the use of Spanish language. Therefore, the current scoring of inconsistencies is correct.
  • In May and June 2012 Andy Dean produced the final tables and figures below. No errors were found.

Data Distributions

Data below EXCLUDED participants who were flagged for any reason and those who were not completers. Participants who were not healthy controls (e.g., ADHD, schizophrenia) were also excluded. Also, the data below EXCLUDED the participants who received the task with a typo on item number 7.

Evaluation of Inconsistent Responding: Frequencies

InconsisDDT1.png

Histograms and frequencies (excluding inconsistent responders from any magnitude)

Small magnitude raw k values

SmallKfreq.png

SmallKfreqTable.png

Small magnitude logged k values

SmallKlog.png

Medium magnitude raw k values

MediumKfreq.png

MediumKfreqTable.png

Medium magnitude logged k values

MediumKlog.png

Large magnitude raw k values

LargeKfreq.png

LargeKfreqTable.png

Large magnitude logged k values

LargeKlog.png

All magnitudes raw k values

AllKfreq.png

All magnitudes logged k values

AllKlog.png

Relationship between demographics and logged total k value

Non significant trend with age

AgeDDT.png

No relation with gender (p = .77)

GenderDDT.png

Negative relationship between education and delay discounting

EduDDT.png

Relationship between ethnicity and delay discounting (p = .000)

EthnicityDDT.png

References

Audrain-McGovern J, Rodriquez D, Epstein LH, Cuevas J, Rodgers K, Wileyto EP (2009) Does delay discounting play an etiological role in smoking or is it a consequence of smoking? Drug Alcohol Dep 103: 99-106.

Kirby KN, Petry NM (2004) Heroin and cocaine abusers have higher discount rates for delayed rewards than alcoholics or non-drug-using-controls. Addiction 99: 461-471.

Kirby KN, Petry NM, Bickel WK (1999) Heroin addicts have higher discount rates for delayed rewards than non-drug-using controls. J Exp Psychology: General 128: 78-87.

Reynolds B, Schiffbauer R (2004) Measuring state changes in human delay discounting: An experiential discounting task. Behavioural Processes 67: 343-356.

go back to HTAC