* Encoding: UTF-8.

*######################################################################################.
*#
*#   Create variables, recoding scales, general setup.
*#
*######################################################################################.

*####CREATING VARIABLES TO ONLY INCLUDE IMPULSE PURCHASES.
COMPUTE TotalImpulseProducts=Number_Products_Ordered_T-NumberPlannedPurchases.
EXECUTE.

COMPUTE TotalImpulseDollars=Total_After_Discount_T-DollarsSpentPlannedProducts.
EXECUTE.

*####IMPULSE BUYING SCALE: REVERSE SCORING, SUMMATION, AND INTERACTION TERM.
IF  (IBT5=7) IBT5_NEW=1.
EXECUTE.
IF  (IBT5=6) IBT5_NEW=2.
EXECUTE.
IF  (IBT5=5) IBT5_NEW=3.
EXECUTE.
IF  (IBT5=4) IBT5_NEW=4.
EXECUTE.
IF  (IBT5=3) IBT5_NEW=5.
EXECUTE.
IF  (IBT5=2) IBT5_NEW=6.
EXECUTE.
IF  (IBT5=1) IBT5_NEW=7.
EXECUTE.

COMPUTE IB_SCALE=IBT1+IBT2+IBT3+IBT4+IBT5_NEW.
EXECUTE.

COMPUTE IB_SCALE_X_Condition= IB_SCALE * TreatmentGroup.
EXECUTE.

*####CREATE BINARY VARIABLE: DID MAKE IMPULSE PURCHASE.

IF  (TotalImpulseProducts >=1) MadeImpulseBuy_YN=1.
EXECUTE.

IF  (TotalImpulseProducts =0) MadeImpulseBuy_YN=0.
EXECUTE.

*###Added an impulse product to cart YN.
COMPUTE AddedImpulseToCart_YN=0.
EXECUTE.

IF  (AddsToCart_Impulsive>0) AddedImpulseToCart_YN=1.
EXECUTE.

*######################################################################################.
*#
*#   Descriptive stats.
*#
*######################################################################################.

*FOR ALL PARTICIPANTS.

FREQUENCIES VARIABLES=Motivation SelfEfficacy Impulse_buy_Frequency Gender Age IB_SCALE 
    Total_After_Discount_T Total_Minutes_Shopping_T TotalImpulseProducts TotalImpulseDollars 
    Number_Products_Ordered_T
  /STATISTICS=STDDEV MINIMUM MAXIMUM MEAN MEDIAN
  /ORDER=ANALYSIS.

FREQUENCIES VARIABLES=Income Maritial Education
  /STATISTICS=STDDEV MINIMUM MAXIMUM MEAN MEDIAN
  /ORDER=ANALYSIS.

FREQUENCIES VARIABLES= Num_White_Bear_Checkmarks_T 
  /STATISTICS=STDDEV MINIMUM MAXIMUM MEAN MEDIAN
  /ORDER=ANALYSIS.

GRAPH
  /HISTOGRAM(NORMAL)=Income.

GRAPH
  /HISTOGRAM(NORMAL)=Maritial.

GRAPH
  /HISTOGRAM(NORMAL)=Education.

GRAPH
  /HISTOGRAM(NORMAL)=Motivation.

GRAPH
  /HISTOGRAM(NORMAL)=SelfEfficacy.

*# Multiple response variables: Race, 

MULT RESPONSE GROUPS=$Race (white hispanic black nativeamerican asian pacificislander otherrace (1))    
  /FREQUENCIES=$Race.

MULT RESPONSE GROUPS=$Employment (fulltime parttime outofworklooking outofworknotlooking stayhome 
    student military retired uablework (1))
  /FREQUENCIES=$Employment.

*FOR CONTROL PARTICIPANTS.

USE ALL.
COMPUTE filter_$=(Group1or2_T = 1).
VARIABLE LABELS filter_$ 'Group1or2_T = 1 (FILTER)'.
VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'.
FORMATS filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE.

FREQUENCIES VARIABLES=Motivation SelfEfficacy Impulse_buy_Frequency Gender Age IB_SCALE 
    Total_After_Discount_T Total_Minutes_Shopping_T TotalImpulseProducts TotalImpulseDollars 
    Number_Products_Ordered_T Num_White_Bear_Checkmarks_T TotalAddsToCart_ImpulseAndPlanned_PP 
    AddsToCart_Impulsive NumberPlannedPurchases MadeImpulseBuy_YN
  /STATISTICS=STDDEV MINIMUM MAXIMUM MEAN MEDIAN
  /ORDER=ANALYSIS.

*FOR TREATMENT  PARTICIPANTS.

USE ALL.
COMPUTE filter_$=(Group1or2_T = 2).
VARIABLE LABELS filter_$ 'Group1or2_T = 2 (FILTER)'.
VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'.
FORMATS filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE.

FREQUENCIES VARIABLES=Motivation SelfEfficacy Impulse_buy_Frequency Gender Age IB_SCALE 
    Total_After_Discount_T Total_Minutes_Shopping_T TotalImpulseProducts TotalImpulseDollars 
    Number_Products_Ordered_T Num_White_Bear_Checkmarks_T TotalAddsToCart_ImpulseAndPlanned_PP 
    AddsToCart_Impulsive NumberPlannedPurchases MadeImpulseBuy_YN AddedProductToCart_YN ShoppedWhileWaiting 
    CheckedPhoneWhileWaiting num_times_patience_checked_PP ChangeMindNoBuy
  /STATISTICS=STDDEV MINIMUM MAXIMUM MEAN MEDIAN
  /ORDER=ANALYSIS.

*######################################################################################.
*Attitudes about the App.
*Just those in Treatment group who noticed they had to wait.

*######################################################################################.
USE ALL.
COMPUTE filter_$=(NoticeHadToWait = 1).
VARIABLE LABELS filter_$ 'NoticeHadToWait = 1 (FILTER)'.
VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'.
FORMATS filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE.

DESCRIPTIVES VARIABLES=NoticeHadToWait ChangeMindNoBuy WaitingHelpedDecisions WaitingNotHelpful 
    WouldLikeApp
  /STATISTICS=MEAN STDDEV MIN MAX.

FREQUENCIES VARIABLES=WaitingHelpedDecisions WaitingNotHelpful WouldLikeApp
  /STATISTICS=STDDEV MINIMUM MAXIMUM MEAN MEDIAN
  /ORDER=ANALYSIS.

*######################################################################################.
*#
*#   Hypothesis testing, H1 and H2.
*#
*######################################################################################.

******************** ALL PARTICIPANTS.

FILTER OFF.
USE ALL.
EXECUTE.

*####IND SAMPLES T-TEST -products. 
T-TEST GROUPS=Group1or2_T(1 2)
  /MISSING=ANALYSIS
  /VARIABLES=TotalImpulseProducts
  /CRITERIA=CI(.95).

GRAPH
  /BAR(SIMPLE)=MEAN(TotalImpulseProducts) BY Group1or2_T
  /INTERVAL SE(2.0)
  /TITLE='Impulse products purchased'.

*####IND SAMPLES T-TEST -dollars. 
T-TEST GROUPS=Group1or2_T(1 2)
  /MISSING=ANALYSIS
  /VARIABLES=TotalImpulseDollars
  /CRITERIA=CI(.95).

GRAPH
  /BAR(SIMPLE)=MEAN(TotalImpulseDollars) BY Group1or2_T
  /INTERVAL SE(2.0)
  /TITLE='Impulse dollars spent'.

*######################################################################################.
*#
*#   Hypothesis testing, H3 Proportions (Bought/Added to Cart)
*#
*######################################################################################.

********************CONTROL.
USE ALL.
COMPUTE filter_$=(Group1or2_T=1).
VARIABLE LABELS filter_$ 'Group1or2_T=1 (FILTER)'.
VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'.
FORMATS filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE.

FREQUENCIES VARIABLES=TotalImpulseProducts AddsToCart_Impulsive
  /STATISTICS=STDDEV MINIMUM MAXIMUM MEAN MEDIAN
  /ORDER=ANALYSIS.

********************TREATMENT, ALL PARTICIPANTS.

USE ALL.
COMPUTE filter_$=(Group1or2_T=2).
VARIABLE LABELS filter_$ 'Group1or2_T=2 (FILTER)'.
VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'.
FORMATS filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE.

FREQUENCIES VARIABLES=TotalImpulseProducts AddsToCart_Impulsive
  /STATISTICS=STDDEV MINIMUM MAXIMUM MEAN MEDIAN
  /ORDER=ANALYSIS.

*######################################################################################.
*#
*#   Additional Test: Comparing proportion of those who made an IB across conditions
*#
*######################################################################################.

FILTER OFF.
USE ALL.
EXECUTE.

CROSSTABS
  /TABLES=Group1or2_T BY MadeImpulseBuy_YN
  /FORMAT=AVALUE TABLES
  /STATISTICS=CHISQ 
  /CELLS=COUNT PROP 
  /COUNT ROUND CELL.

*######################################################################################.
*#
*#   Exploratory analysis.
*#
*######################################################################################.

*######### CORRELATIONS  #################.

  CORRELATIONS
  /VARIABLES=TotalImpulseProducts Total_Minutes_Shopping_T Num_White_Bear_Checkmarks_T 
    Motivation SelfEfficacy Age Education IB_SCALE Impulse_buy_Frequency
  /PRINT=TWOTAIL NOSIG
  /MISSING=PAIRWISE.

CORRELATIONS
  /VARIABLES=TotalImpulseDollars Total_Minutes_Shopping_T Num_White_Bear_Checkmarks_T 
     Motivation SelfEfficacy Age Education IB_SCALE Impulse_buy_Frequency
  /PRINT=TWOTAIL NOSIG
  /MISSING=PAIRWISE.

*######### REGRESSION #################.

********* DV=Impulse Products ******.

* MODEL, everything that thought to be influential.
REGRESSION
  /MISSING LISTWISE
  /STATISTICS COEFF OUTS R ANOVA
  /CRITERIA=PIN(.05) POUT(.10)
  /NOORIGIN 
  /DEPENDENT TotalImpulseProducts
  /METHOD=ENTER TreatmentGroup IB_SCALE Male Age Total_Minutes_Shopping_T Education.

* MODEL removing edu.
REGRESSION
  /MISSING LISTWISE
  /STATISTICS COEFF OUTS R ANOVA
  /CRITERIA=PIN(.05) POUT(.10)
  /NOORIGIN 
  /DEPENDENT TotalImpulseProducts
  /METHOD=ENTER TreatmentGroup IB_SCALE Male Age Total_Minutes_Shopping_T.

* MODEL adding interaction term.
REGRESSION
  /MISSING LISTWISE
  /STATISTICS COEFF OUTS R ANOVA
  /CRITERIA=PIN(.05) POUT(.10)
  /NOORIGIN 
  /DEPENDENT TotalImpulseProducts
  /METHOD=ENTER TreatmentGroup IB_SCALE Male Age Total_Minutes_Shopping_T  IB_SCALE_X_Condition.

********* DV= Impulse Dollars ******.

* MODEL 4, everything that thought to be influential.
REGRESSION
  /MISSING LISTWISE
  /STATISTICS COEFF OUTS R ANOVA
  /CRITERIA=PIN(.05) POUT(.10)
  /NOORIGIN 
  /DEPENDENT TotalImpulseDollars
  /METHOD=ENTER TreatmentGroup IB_SCALE Male Age Total_Minutes_Shopping_T Education.

*removing edu.
REGRESSION
  /MISSING LISTWISE
  /STATISTICS COEFF OUTS R ANOVA
  /CRITERIA=PIN(.05) POUT(.10)
  /NOORIGIN 
  /DEPENDENT TotalImpulseDollars
  /METHOD=ENTER TreatmentGroup IB_SCALE Male Age Total_Minutes_Shopping_T.

* removing age.
REGRESSION
  /MISSING LISTWISE
  /STATISTICS COEFF OUTS R ANOVA
  /CRITERIA=PIN(.05) POUT(.10)
  /NOORIGIN 
  /DEPENDENT TotalImpulseDollars
  /METHOD=ENTER TreatmentGroup IB_SCALE Male Total_Minutes_Shopping_T.

* MODEL removing time.
REGRESSION
  /MISSING LISTWISE
  /STATISTICS COEFF OUTS R ANOVA
  /CRITERIA=PIN(.05) POUT(.10)
  /NOORIGIN 
  /DEPENDENT TotalImpulseDollars
  /METHOD=ENTER TreatmentGroup IB_SCALE Male.

* MODEL adding interaction term.
REGRESSION
  /MISSING LISTWISE
  /STATISTICS COEFF OUTS R ANOVA
  /CRITERIA=PIN(.05) POUT(.10)
  /NOORIGIN 
  /DEPENDENT TotalImpulseDollars
  /METHOD=ENTER TreatmentGroup IB_SCALE Male IB_SCALE_X_Condition.

*######### Percentage of TREATMENT participants who shopped during delay period #################.

*Treatment participants who added a product to their cart. 

USE ALL.
COMPUTE filter_$=((Group1or2_T=2) & (AddedProductToCart_YN=1)).
VARIABLE LABELS filter_$ '(Group1or2_T=2) & (AddedProductToCart_YN=1) (FILTER)'.
VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'.
FORMATS filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE.

FREQUENCIES VARIABLES=ShoppedWhileWaiting CheckedPhoneWhileWaiting
  /ORDER=ANALYSIS.

*######################################################################################.
*#
*#   REGRET SCORES ANALYSIS
*#
*######################################################################################.

FILTER OFF.
USE ALL.
EXECUTE.

FREQUENCIES VARIABLES=RegretScore1 RegretScore2 RegretScore3 Average_Regret
  /STATISTICS=RANGE MINIMUM MAXIMUM MEAN MEDIAN MODE
  /ORDER=ANALYSIS.

T-TEST GROUPS=Group1or2_T(1 2)
  /MISSING=ANALYSIS
  /VARIABLES=Average_Regret
  /CRITERIA=CI(.95).

GRAPH
  /HISTOGRAM(NORMAL)=Average_Regret.

GRAPH
  /BAR(SIMPLE)=MEAN(Average_Regret) BY Group1or2_T
  /INTERVAL SE(2.0)
  /TITLE='Regret'.

*######################################################################################.
*#
*#   END.
*#
*######################################################################################.