Submitted by: Submitted by djethen
Views: 10
Words: 2378
Pages: 10
Category: Science and Technology
Date Submitted: 10/26/2015 03:11 AM
Question 1 –Chi Square, Confidence Interval
The table below shows the counts of reach by age group and gender for a particular facebook page.
13–24 | 25–34 | 35–44 | 45+ | Total |
F | 7 | 19 | 42 | 7 | 75 |
M | 24 | 44 | 45 | 12 | 125 |
Total | 31 | 63 | 87 | 19 | 200 |
The owner of this page is interested in determining whether the age profile of reach varies by gender.
(a) Find expected counts for each entry in the table assuming gender and age group
are independent.
Expected Count = (Column Total*Row Total)/Total in sample (n)
Eg. Females 13-24
(31*75)/200=11.63
EXPECTED COUNTS FOR EACH CATEGORY (PART A) |
| 13-24 | 25-34 | 35-44 | 45+ | Total |
Female | 11.63 | 23.63 | 32.63 | 7.13 | 75 |
Male | 19.38 | 39.375 | 54.38 | 11.88 | 125 |
Total | 31 | 63 | 87 | 19 | 200 |
(b)Calculate a X2 statistic for testing whether the age profile varies by gender, and
state its degrees of freedom.
OBSERVED COUNTS VS (EXPECTED COUNTS) (PART B) |
| 13-24 | 25-34 | 35-44 | 45+ | Total |
Female | 7(11.63) | 19(23.63) | 42(32.63) | 7(7.13) | 75 |
Male | 24(19.38) | 44(39.375) | 45(54.38) | 12(11.88) | 125 |
Total | 31 | 63 | 87 | 19 | 200 |
To calculate the X statistic (X2) you have to do the (O-E)^2/E bit of the formula for each expected value and add them all together:
O= Observed count
E= Expected count
Eg. On Calc of Female 13-24
Eg. On Calc of Female 13-24
X2 statistic = 8.70
Degree of freedom = (Rows-1)*(Columns-1) = (2-1)*(4-1) = 3
(c)Computea95%confidenceintervalfortheproportionoffemales. (Recallthat
z0.025=1.960)
p=75/200 (0.375)(proportion of sample)
n=200 (number in sample)
z=1.960 (95%)
Formula:
∆ = z * √(p(1-p)/n)
∆ = 1.960 * √(0.375*(1-0375)/200) = 0.067
Confidence Interval = p±∆ = 0.375±0.067 = (0.308, 0.442)
Question 2 –Stopwords, Document-Term Matrix, Cosine Similarity, TF-IDF Weight
Using the three documents:
i. Go dog, go!
ii. Stop cat, stop
iii. The dog stops the cat and...