In: Statistics and Probability
Load the library MASS.use dim statement to view columns and observations.
with print statement print the observations
To view the column names use names statement
Rcode is:
library(MASS)
dim(quine)
names(quine)
print(quine)
head(quine)
Ou Eth Sex Age Lrn Days
1 A M F0 SL 2
2 A M F0 SL 11
3 A M F0 SL 14
4 A M F0 AL 5
5 A M F0 AL 5
6 A M F0 AL 13
Solutionb;
b) Is the proportion of aboriginal female different from that of male?
use below R code:
prop.test(table(quine$Eth,quine$Sex))
Output:
2-sample test for equality of proportions with continuity correction
data: table(quine$Eth, quine$Sex)
X-squared = 2.606e-30, df = 1, p-value = 1
alternative hypothesis: two.sided
95 percent confidence interval:
-0.1616919 0.1722321
sample estimates:
prop 1 prop 2
0.5507246 0.5454545
p=1
there is no sufficient statistical evidence at 5% level of significance to conclude that proportion of aboriginal female different from that of male
that is proportion of aboriginal femaleis not different from that of male.