Sunteți pe pagina 1din 6

Takehome 2 11/7/17, 2'59 PM

Takehome 2
mrwebb
11/6/2017

Money Priming
manylabs = read.table("manylabs.txt", header = TRUE)
control = manylabs$Sysjust[manylabs$MoneyGroup==0]
control <- na.omit(control)
moneyprime = manylabs$Sysjust[manylabs$MoneyGroup==1]
moneyprime <- na.omit(moneyprime)

Part 1
(2 points.) Draw at least one and at most two informative graphs of your data. (There are lots
of choices.) Make sure to label your graphs clearly.

plot(density(control), col = "red", xlab = "Justification Values",


ylab = "Density (black = primed, red = control)",
main = "System Justification")
lines(density(moneyprime))

file:///Users/mwebb/Desktop/Takehome2.html Page 1 of 6
Takehome 2 11/7/17, 2'59 PM

Part 2
(1 point.) Carefully define the populations (in words) and the parameter of interest (in math
symbols) for your study.
The Money Priming study sampled two populations of international citizens. One control population and one
money-primed population. Let µ2 be the expected system justification value of the control citizens and let µ1
be the system justification value of the money-primed citizens. The parameter of interst will be the difference
in the expected values of these two populations. Let ∆ = µ2 - µ1 represent this difference.

#µ1 = mean(moneyprime)
#µ2 = mean(control)
#∆ = µ1 - µ2

Part 3
(1 point.) Write down hypotheses for a one-tailed test of your data. Make sure you have
carefully stated which way around you’re doing the subtraction.

file:///Users/mwebb/Desktop/Takehome2.html Page 2 of 6
Takehome 2 11/7/17, 2'59 PM

For a one-tailed test on the Money Priming data we make the assumtion for our null hypothesis the money-
primed population won’t show an increase in the system justification value in that the calculated value for ∆
should be approximately 0. As we wish to disprove the null hypotheses (H0) (Similar to original study) and
accept the alternative (H1) showing the positive impact of money-priming, we will conduct the one-tailed test
as follows:

#Null -> H0: ∆ ≤ 0


#Alternative -> H1: ∆ > 0

Part 4
(2 points.) Name the statistical test you will perform on the data. Justify your choice of test by
either verifying assumptions or arguing that assumptions can be ignored.
We will perform Welch’s 2-sample t-test on our Money priming data. We make the assumtion that our data is
independent and normal. We hope that samples from each population are evenly distributed in coutry of origin
and demographic within. The qqnorm plots below appear straight and normal.

qqnorm(control, main = "QQ plot of System Justification of control")

file:///Users/mwebb/Desktop/Takehome2.html Page 3 of 6
Takehome 2 11/7/17, 2'59 PM

qqnorm(moneyprime, main = "QQ plot of System Justification of money-prime", ylab = "Q


uantiles of sample distances")

file:///Users/mwebb/Desktop/Takehome2.html Page 4 of 6
Takehome 2 11/7/17, 2'59 PM

Part 5
(3 points.) Perform an appropriate one-tailed test on the data. State your test statistic,
degrees of freedom (if any), and your P -value.

#Test statistic t = ∆/se


delta_hat = mean(moneyprime) - mean(control)
n1 = length(moneyprime)
n2 = length(control)
se = sqrt((var(moneyprime)/n1) + (var(control)/n2))
t = delta_hat/se
nu = (var(moneyprime)/n1+ var(control)/n2)^2/((var(moneyprime)/n1)^2/(n1-1)+(var(cont
rol)/n2)^2/(n2-1))
p = 1- pt(abs(t), df = nu)
#Test Statistic
t

## [1] -0.7874304

file:///Users/mwebb/Desktop/Takehome2.html Page 5 of 6
Takehome 2 11/7/17, 2'59 PM

#Degrees of freedom
nu

## [1] 6328.546

#P-value
p

## [1] 0.2155297

Part 6
(3 points.) With large sample sizes, we might want to do confidence intervals at 99% confi-
dence instead of 95%. Give a 99% confidence interval for the parameter of interest.

q = qt(0.995, df = nu)
lower = delta_hat - q *se
upper = delta_hat + q *se

Part 7
(2 points.) Was the hypothesized effect replicated in your data? Explain your conclusions to
psychologists who may not have a firm grasp on statistics.
Accept null P >> 0.05 ###Part 8 #####(1 point.) Include your R code. After reading in the data, we should be
able to reproduce your graphs and numerical results by just copy-pasting your code.

file:///Users/mwebb/Desktop/Takehome2.html Page 6 of 6

S-ar putea să vă placă și