Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
kbelisar authored Mar 20, 2021
1 parent a22217a commit 88e0750
Showing 1 changed file with 27 additions and 20 deletions.
47 changes: 27 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
# PurchaseTasks Repository
This repository contains the script for processing APT, CPT, and MPT data for PBCAR. This READ ME document introduces users to purchase tasks. It also walks users through the process of running this script who have little working knowledge of R.
This repository contains the script for processing purchase task data. This READ ME document introduces users to purchase tasks. It also walks users through the process of running this script who have little working knowledge of R.

# Introduction to Purchase Tasks

These demand instruments are used to measure the reinforcer pathology - the extent to which a value for a commodity is effected by increased cost. Greater demand (i.e. little sensitivity to price changes) is often associated with substance-related problems and use disorders (see Bickel et al. (2011). The Behavioral Economics and Neuroeconomics of Reinforcer Pathologies: Implications for Etiology and Treatment of Addiction). There are 5 different indices generated by the purchase task:

**Breakpoint** - The first increment of cost at which no alcohol/cannabis/cigarettes would be consumed
**Breakpoint** - The first increment of cost with zero consumption

**Intensity** - Consumption when drinks/cannabis/cigarettes are free
**Intensity** - Consumption at the first price point

**Omax** - The maximum alcohol/cannabis/cigarette expenditure
**Omax** - The maximum expenditure

**Pmax** - The price associated with the maximum total expenditure

**Alpha** - Referred to as Elasticity, measures sensitivity of alcohol/cannabis/cigarette consumption to increases in cost
**Elasticity** - Measures sensitivity of consumption to increases in cost

Elasticity, a curve analysis, tests k = 2,3,4 in the mean data using the exponentiated equation and uses the parameter that yields the best fit. Participants with a value of zero for one or both of the first two items are excluded.

# Overview of Processing

Purchase tasks use branching logic in administering the questions, such that no further prices are presented after a zero response is given within a four-price array. Participants who contradict themselves at the last item of the array are considered missing and are removed, since it cannot be assumed that all subsequent responses would be zeroes.
Purchase tasks often use branching logic in administering the questions, such that no further prices are presented after a zero response within an array. Individuals who contradict themselves at the last item of the array are considered missing and are removed, since it cannot be assumed that all subsequent responses would be zeroes.

## Quality control removes individuals who do NOT meet the following:

i) Exhibit a bounce ratio of of 10% or higher (inconsistencies in values given)
i) Do not exhibit a decelerating trend (referred to as a trend violation). Does not include those with a starting value of 0

ii) Do not exhibit a decelerating trend (referred to as a trend violation). Does not include those with a starting value of 0
ii) Exhibit a bounce ratio of of 10% or higher (inconsistencies in values given)

iii) Exhibit 2 or more reversals. A reversal is 2 or more consecutive 0's prior to a positive value


**Winsorization at the price level** occurs for values with a z score +/- 3.99, whereby the outlying value is changed to the nearest non-outlying value.

**Winsorizing at the index level** occurs for values with a z score +/- 3.99. Outliers are recoded as 0.001 greater than the next highest non-outlying value, thus retaining order.
Expand All @@ -37,7 +37,7 @@ The winsorizing type used for both price and index level values is preserve orde

# Purchase Task Template

Processed Data provides two sets of these indices:
Processed data provides two sets of these indices:

i) Winsorized variables (at both the price and index level), as denoted by the suffix `_W`

Expand All @@ -50,21 +50,24 @@ This script utilizes the {beezdemand} package to process the behavioural economi

## Changes Required:

There are 6 changes required by the user of this script. These are outlined at the top of the script, with examples:
There are 7 changes required by the user of this script. These are outlined at the top of the script, with examples:

a) Set your working directory - This is the file location of your data to be analyzed. To set your working directory, go to:

Session > Set Working Directory > Choose Directory

b) Input the name of your data file (this script is set up to only import .csv files)

c) Copy and Paste the ID variable name, along with the name of the purchase task items ONLY (the iD name must be first in the list)
c) Input the name of your ID variable

d) Copy and Paste all the names of the purchase task items

e) Assign the price associated with each purchase task item

d) ASSIGN the price associated with each purchase task item
f) Input the maximum allowed value identified in the purchase task

e) IDENTIFY the maximum allowed value identified in the purchase task
g) Input the total N individuals in the data set

f) Input the total N of participants in the data set

## The Script:

Expand All @@ -84,12 +87,16 @@ This script uses R-markdown to produce a PDF report of the processed data. It is

It requires the user to:

A) Save the data set and the script in the same file location
a) Save the data set and the script in the same file location

b) Name of the .csv file

c) The name of the ID variable

B) Name of the .csv file
d) The names of the purchase task item variables

C) The name of the participant ID variable along with the names of the purchase task variables ONLY (the ID name must be first in the list)
e) The price of each purchase task item

D) Select the type of purchase task: APT, CPT, or MPT
f) Input the maximum allowed value identified in the purchase task

E) Input the total N of participants included in the data set
g) Input the total N individuals in the data set

0 comments on commit 88e0750

Please sign in to comment.