In: Statistics and Probability
Use the smartphone data. Test if the phone type ("Phone Type") and beliefs about the impact of social media ("Impact of SocNetworking" ) are related or not. Use R to find the test statistic.
Phone Type | Impact of SocNetworking |
iPhone | worse |
Android smartphone | better |
Android smartphone | better |
iPhone | better |
iPhone | worse |
iPhone | no impact |
Android smartphone | better |
iPhone | no impact |
iPhone | no impact |
iPhone | better |
Android smartphone | no impact |
Android smartphone | better |
iPhone | better |
Android smartphone | worse |
Android smartphone | no impact |
Android smartphone | better |
Android smartphone | better |
iPhone | better |
Android smartphone | no impact |
iPhone | better |
Android smartphone | worse |
Android smartphone | worse |
iPhone | better |
Android smartphone | no impact |
iPhone | no impact |
iPhone | better |
Android smartphone | no impact |
iPhone | better |
iPhone | better |
iPhone | no impact |
Android smartphone | better |
Android smartphone | worse |
iPhone | better |
Android smartphone | worse |
iPhone | better |
Android smartphone | better |
Android smartphone | better |
Android smartphone | better |
Android smartphone | no impact |
Android smartphone | worse |
Android smartphone | worse |
Android smartphone | better |
iPhone | better |
iPhone | better |
iPhone | better |
iPhone | worse |
Android smartphone | better |
Android smartphone | no impact |
iPhone | better |
iPhone | better |
iPhone | worse |
iPhone | better |
iPhone | better |
iPhone | better |
iPhone | better |
Android smartphone | worse |
iPhone | no impact |
iPhone | better |
Android smartphone | no impact |
iPhone | better |
iPhone | better |
Android smartphone | worse |
iPhone | better |
iPhone | better |
Android smartphone | worse |
iPhone | better |
iPhone | no impact |
Android smartphone | no impact |
iPhone | better |
Android smartphone | better |
iPhone | better |
iPhone | no impact |
iPhone | no impact |
Android smartphone | worse |
iPhone | better |
iPhone | better |
The Null and Alternative hypothesis are
H0: Phone Type and Impact of SocNetworking are not related
Ha: Phone Type and Impact of SocNetworking are related
The contigency table is
Observed Frequency(Oi) | Phone Type | ||
Impact of Social Networking | Android smartphone | iPhone | Grand Total |
better | 13 | 30 | 43 |
no impact | 9 | 9 | 18 |
worse | 11 | 4 | 15 |
Grand Total | 33 | 43 | 76 |
Expected Frequency(Ei) | Phone Type | ||
Impact of Social Networking | Android smartphone | iPhone | Grand Total |
better | 18.67105263 | 24.3289 | 43 |
no impact | 7.815789474 | 10.1842 | 18 |
worse | 6.513157895 | 8.48684 | 15 |
Grand Total | 33 | 43 | 76 |
Expected Frequncy=(RowTotal*ColumnTotal) / Grand Total
The Chisquare Statistics is
= 8.824588
Using R
>d=read.csv(file.choose(),header=T) #First import the
data
>attach(d)
>t=table(Impact.of.SocNetworking,Phone.Type)
> t
Phone.Type
Impact.of.SocNetworking Android.smartphone iPhone
better
13 30
no.impact
9 9
worse
11 4
> c=chisq.test(t)
> c
Pearson's Chi-squared test
data: t
X-squared = 8.8246, df = 2, p-value =
0.01213
> pval
[1] 0.01212733
> c$stat
X-squared
8.824588
> pval<0.05 # alpha=0.05 level of significance
[1] TRUE
>#here pvalue<.05 then we reject the
Null hypothisis and conclude that Phone Type and
Impact of SocNetworking are related