RE: [R] Stats Question: Single data item versus Sample from Norma l Distribution

From: Liaw, Andy <>
Date: Tue 05 Apr 2005 - 20:35:30 EST

Here's one possibility, assuming muhat and sigmahat are estimtes of mu and sigma from N iid draws of N(mu, sigma^2):

tStat <- abs(x - muhat) / sigmahat
pValue <- pt(tStat, df=N, lower=TRUE)

I'm not quite sure what df tStat should have (exercise for math stat), but given fairly large N, that should make little difference.


> From: Ross Clement
> Hi. I have a question that I have asked in other stat forums
> but do not
> yet have an answer for. I would like to know if there is some way in R
> or otherwise of performing the following hypothesis test.
> I have a single data item x. The null hypothesis is that x
> was selected
> from a normal distribution N(mu,sigma). The alternate
> hypothesis is that
> x does not come from this distribution.
> However, I do not know the values of mu and sigma. I have a sample of
> size N from which I can estimate mu and sigma. So, say that I have
> N(m,s,N), and x. I would like to say with some certainty
> (e.g. 95%) that
> I can, or can't reject the hypothesis that x came from N(mu,sigma). I
> would also like a power test to say how large N should be given the
> degree of accuracy I need when accepting or rejecting individual x
> values.
> What is the name of the hypothesis test I need for this? Is it built
> into R, or are there packages I could use?
> Thanks in anticipation,
> Ross Clement.
> ______________________________________________
> mailing list
> PLEASE do read the posting guide!
> mailing list PLEASE do read the posting guide! Received on Tue Apr 05 20:40:51 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:01 EST