You are here

Group Exercise: Another Confidence Interval

Compute the 95% confidence interval for a numeric variable from ANES 2016. Interpret the results. Paste your R code beneath your interpretation.

Comments

t.test(V162078,mu=50)

> ANES2016<-read.csv("http://www.shortell.nyc/online/files/anes_timeseries_2016.csv")
> View(ANES2016)
> attach(ANES2016)
> t.test(V162078,mu=50)

One Sample t-test

data: V162078
t = -9.4593, df = 3624, p-value < 2.2e-16
alternative hypothesis: true mean is not equal to 50
95 percent confidence interval:
42.84131 45.29938
sample estimates:
mean of x
44.07034

ANES2016<-read.csv("http://www.shortell.nyc/online/files/anes_timeseries_2016.csv")
> View(ANES2016)
> attach(ANES2016)
> t.test(V161093,mu=50)

One Sample t-test

data: V161093
t = -1.5473, df = 4234, p-value = 0.1219
alternative hypothesis: true mean is not equal to 50
95 percent confidence interval:
48.25003 50.20616
sample estimates:
mean of x
49.2281

INTERPRETATION:
95% confident that the mean of favorability over Bill Clinton falls betwen 48 and 50 degree with a mean of 49 degrees.

> t.test(V162100, mu=50)

One Sample t-test

data: V162100
t = 2.8113, df = 3613, p-value = 0.00496
alternative hypothesis: true mean is not equal to 50
95 percent confidence interval:
50.77225 54.33179
sample estimates:
mean of x
52.55202

I'm 95% confident that 50.8 and 54.3 is the probability of favor ability toward big businesses.

95 percent confidence interval:
48.25003 50.20616
sample estimates:
mean of x
49.2281

> t.test(V161096,mu=50)

One Sample t-test

data: V161096
t = -15.374, df = 4184, p-value < 2.2e-16
alternative hypothesis: true mean is not equal to 50
95 percent confidence interval:
42.67746 44.33377
sample estimates:
mean of x
43.50562

I am 95% confident that 42.7 to 44.3 is the probability of favor ability toward the republican party

> t.test(V162113,mu=50)

One Sample t-test

data: V162113
t = 4.1892, df = 3620, p-value = 2.866e-05
alternative hypothesis: true mean is not equal to 50
95 percent confidence interval:
53.45266 59.52773
sample estimates:
mean of x
56.4902
I am 95% confident that the mean favorability towards black lives matter is between 53.453 and 59.528

t.test(V161167, mu=50)

One Sample t-test

data: V161167
t = -2245.2, df = 4244, p-value < 2.2e-16
alternative hypothesis: true mean is not equal to 50
95 percent confidence interval:
3.683031 3.763848
sample estimates:
mean of x
3.723439

I am 95% perfect confidant that the mean favorbility towards Pres Rep. candidate trait honesty is between 3.6 and 3.7 degrees

> t.test(V161092[V161227==1],V161092[V161227==2])

Welch Two Sample t-test

data: V161092[V161227 == 1] and V161092[V161227 == 2]
t = -29.012, df = 4167.5, p-value < 2.2e-16
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-31.87972 -27.84383
sample estimates:
mean of x mean of y
38.90442 68.76619

> t.test(V161092[V161227==1],mu=50)

One Sample t-test

data: V161092[V161227 == 1]
t = -14.658, df = 2196, p-value < 2.2e-16
alternative hypothesis: true mean is not equal to 50
95 percent confidence interval:
37.41996 40.38887
sample estimates:
mean of x
38.90442

> t.test(V161092[V161227==2],mu=50)

One Sample t-test

data: V161092[V161227 == 2]
t = 26.907, df = 1975, p-value < 2.2e-16
alternative hypothesis: true mean is not equal to 50
95 percent confidence interval:
67.39840 70.13399
sample estimates:
mean of x
68.76619
We reject the Null Hypothesis and are 95% confident that the mean favorability services of same sex couples towards the past president in group 1 is between 37.4 and 40.4 and 95% confident that the mean favorability of same sex couples towards the past president in group 2 is between 67.4 and 70.1.