I'm running a binom.test on the data set UCBAdmissions (comes with R) and am stuck on an error message.
About the data:
> str(UCBAdmissions) table [1:2, 1:2, 1:6] 512 313 89 19 353 207 17 8 120 205 ... - attr(*, "dimnames")=List of 3 ..$ Admit : chr [1:2] "Admitted" "Rejected" ..$ Gender: chr [1:2] "Male" "Female" ..$ Dept : chr [1:6] "A" "B" "C" "D" ...
*Number of females: 1835
*Number of femaled Admitted: 557
*Number of males: 2691
*Number of males Admitted: 1198
I'm trying to answer this question:
"Do you think there was gender discrimination?"
It's a Bernoulli distribution so I am using the binom.test, however I get an error message that I can't make sense of:
no.w <- sum(UCBAdmissions[1,2,]) no.acc.w <- sum(UCBAdmissions[1,2,]) binom.test(no.acc.w,no.w, p = .304, c="two-sided", p=.95) Error in binom.test(no.acc.w, no.w, p = 0.304, c = "two-sided", p = 0.95) : formal argument "p" matched by multiple actual arguments
In advance, thanks for poking holes in this and pointing me in the right direction.
Jen
Best Answer
You set two different values for p in the arguments of the fonction binom.test. Maybe you wanted to write
binom.test(no.acc.w,no.w, p = 0.304, c="two-sided", conf.level=0.95)
You can find the description of this function on this site : http://stat.ethz.ch/R-manual/R-patched/library/stats/html/binom.test.html
Similar Posts:
- Solved – Intuition needed when using weighted average to explain Simpson’s paradox
- Solved – Should I use Chi Squared/Fisher’s Exact Test or McNemar’s Test
- Solved – How to properly calculate the exact p-value for binomial hypothesis testing (e.g. in Excel)
- Solved – Calculate the standard error of the difference between two independent proportions
- Solved – Analysing categorical variables in R with chisq.test, with small/no expected values