Daniel J Wilson

  1. Sales Pitch Question

a/b/c: See Excel print out.

d. Repeat the analyses from (1a) in R.

H0: uStraightSalesPitch = uReciprocity = uFootintheDoor
H1: at least one difference among the means
α = 0.05
Fcv(2,18) = 3.55

#READ IN CSV
tix <- read.csv("/Users/danieljwilson/Dropbox/PROGRAMMING/R/StatsClass/Homework/Hmwrk3Raffle.csv", header = TRUE)

#RUN ANOVA
stacked_groups <- stack(tix)
anova_tix <- aov(values ~ ind, data = stacked_groups)
summary(anova_tix)
##             Df Sum Sq Mean Sq F value  Pr(>F)   
## ind          2  16.09   8.048   6.945 0.00581 **
## Residuals   18  20.86   1.159                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Based on the F-value of 6.945 being larger than our critical value we can say that there is less than a 5% chance that the sample data came from three populations that all have equivalent means.
In fact, based on the p-value, there is only a 0.581% chance that the samples all came from the same population.
We can reject the null hypothesis.

e. Repeat the analyses from (1c) in R.

Is treatment better than no treatment?

H0: (Reciprocity + Foot in the door)/2 - Straight Sales Pitch <=0
H1: (Reciprocity + Foot in the door)/2 - Straight Sales Pitch >0
α = 0.05
Fcv(2,18) = 3.55

cReciprocity = 1
cFootintheDoor = 1
cStraightSalesPitch = -2

Do the two treatments differ?

H0: Reciprocity = Foot in the door
H1: Reciprocity ≠ Foot in the door
α = 0.05
Fcv(2,18) = 3.55

cReciprocity = 1
cFootintheDoor = -1
cStraightSalesPitch = 0

#CALCULATED THIS TIME USING THE TECHNIQUE SHOWN IN CLASS

# ---------------------
# import raw data
# ---------------------
sales = c(1, 0, 1, 2, 1, 4, 2)
cond1 <- data.frame(sales)
cond1$cond <- "ctr1"
cond1$contrast1 <- -2
cond1$contrast2 <- 0

sales = c(3, 1, 2, 3, 4, 2, 3)
cond2 <- data.frame(sales)
cond2$cond <- "ctr2"
cond2$contrast1 <- 1
cond2$contrast2 <- -1

sales = c(3, 5, 3, 3, 4, 3, 5)
cond3 <- data.frame(sales)
cond3$cond <- "exp"
cond3$contrast1 <- 1
cond3$contrast2 <- 1

datAll <- rbind(cond1, cond2 , cond3)
rm(cond1, cond2, cond3, sales)

# ---------------------
# end generate raw data
# ---------------------

# Answer as a GLM
t <- lm(sales ~ cond, data=datAll)
anova(t)
## Analysis of Variance Table
## 
## Response: sales
##           Df Sum Sq Mean Sq F value   Pr(>F)   
## cond       2 16.095  8.0476  6.9452 0.005814 **
## Residuals 18 20.857  1.1587                    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
t.2 <- lm(sales ~ contrast1 + contrast2, data=datAll)
anova(t.2)
## Analysis of Variance Table
## 
## Response: sales
##           Df  Sum Sq Mean Sq F value   Pr(>F)   
## contrast1  1 11.5238 11.5238  9.9452 0.005495 **
## contrast2  1  4.5714  4.5714  3.9452 0.062448 . 
## Residuals 18 20.8571  1.1587                    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

The analysis of these results is the same as for 1c, please see the Excel doc for details.

Daniel J Wilson