[R] One-sample test for p
Greg Snow
Greg.Snow at imail.org
Thu Oct 16 18:17:35 CEST 2008
I don't think that your question was bad form, there are some things you can do in the future to make it better form. Your questions was certainly better form than others who just ask for an answer to their homework without even admitting that it is homework. You were confused about some very fundamental concepts, but that in not necessarily a bad thing.
Confusion correctly applied is the first step on the road to greater understanding.
I would suggest that you go back to your text book and reread the information on testing and work through some more of the examples from the start (you have your hypotheses switched and the understanding of p-values backwards).
For future posting on this list, those of us who are current/former teachers are hesitant to give answers to what looks like homework when we don't know what the teachers intent in giving the homework was (do they want you to work something out for yourself, and just being given the answer will not help you understand where it came from; or have you already done that and learning different ways to do the same thing will expand your knowledge). When others have posted that they have a hw problem that they have already answered by hand or using the official software of the class, they just now want to learn how to do the same thing in R, we have been happy to help.
For your future posts I would suggest (beyond reading the posting guide) that you give detail on what you have already done, what the teacher has said about using software, and what your focus is in asking the question (clarifying if an unexpected result is due to misunderstanding or wrong syntax, vs. finding if there is a better way to do something, etc.)
I have had many students who just get an answer, write it down, and go on without ever stopping to ask if the answer makes sense. You are ahead of them already in the quest for understanding.
We don't want students to take shortcuts that bypass their understanding of something, but I for one would think it was a good thing if any students, after doing the homework the long way, found another way to do it to check their answers and expand their options.
Good luck in learning statistics and R,
--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org
801.408.8111
> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of rr400
> Sent: Thursday, October 16, 2008 6:38 AM
> To: r-help at r-project.org
> Subject: Re: [R] One-sample test for p
>
>
> Thanks for your responses. I know it is bad form asking about these
> things
> but i was really having trouble getting my head around it, and i wanted
> to
> make sure that the cause wasn't due to the commands i was entering into
> R.
> At least now i know it's a conceptual error i am making rather than a
> technical one.
>
> Thanks again for your help. R.
>
> Duncan Murdoch-2 wrote:
> >
> > On 10/16/2008 7:35 AM, Peter Dalgaard wrote:
> >> rr400 wrote:
> >>> Hi, i am doing a statistics course and am having trouble with an
> >>> exercise
> >>> where i need to determine whether my success rate at something is
> higher
> >>> than 80%.
> >>> I was successful in 29 out of 60 trials, so these were the commands
> i
> >>> entered into R:
> >>>> n=60
> >>>> p.hat=29/n
> >>>> p.0=0.8
> >>>> se.0=sqrt(p.0*(1-p.0)/n)
> >>>> z=(p.hat-p.0)/se.0
> >>>> print(z)
> >>> Which returned:
> >>> [1] -6.132224
> >>>> 1-pnorm(z)
> >>> Which returned
> >>> [1] 1
> >>>
> >>> My problem is that i am meant to state a null and alternative
> hypothesis
> >>> which at the moment i have stated as p>0.8 (null) and p≤0.8
> >>> (alternative).
> >>> As things stand, though, a p-value of 1 suggests i should reject
> the
> >>> null
> >>> hypothesis which can't be right since i am obviously successful
> less
> >>> than
> >>> 80% of the time.
> >>> I am not sure where i am getting muddled. Any advice would be
> greatly
> >>> appreciated. Thanks!
> >>
> >> This isn't really about R, and maybe it is homework, but now that we
> got
> >> you in the appropriate frame of mind:
> >>
> >> (a) p values should look at "this or more unfavourable" events. You
> have
> >> arranged things so that that translates to -6.13 or _lower_. I.e.
> you're
> >> looking at the wrong tail.
> >
> > I think he was looking at the right tail, since his p value was 1.
> Your
> > comment (b) is the important one; comment (c) might not be allowed by
> > his instructor, which is one reason I'm always reluctant to give
> advice
> > on other people's homework problems.
> >
> > Duncan Murdoch
> >
> >>
> >> (b) Make sure you get your accept/reject logic right. You _reject_
> the
> >> null when data would be _un_likely if the null hypothesis were true.
> >>
> >> (c) You might also want to play with binom.test and prop.test
> >>
> >
> > ______________________________________________
> > R-help at r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> > http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
> >
> >
>
> --
> View this message in context: http://www.nabble.com/One-sample-test-
> for-p-tp20010677p20012878.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-
> guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help
mailing list