From 88e07509d2337f87b25885aabb27c069acf33fb7 Mon Sep 17 00:00:00 2001 From: Kyla Belisario <71769015+kbelisar@users.noreply.github.com> Date: Sat, 20 Mar 2021 11:02:39 -0400 Subject: [PATCH] Update README.md --- README.md | 47 +++++++++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index e91994f..cfb9a26 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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` @@ -50,7 +50,7 @@ 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: @@ -58,13 +58,16 @@ a) Set your working directory - This is the file location of your data to be ana 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: @@ -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