Let's say you want to compare "one observation" with a sample, how would you use R to get a p-value for that single observation itself? To clarify what I'm asking: We know you use a one-sample t test to compare an actual sample to a hypothetical value, and a Wilcoxon test if it's not normally distributed, in R either "t.test( )" or "wilcox.test( )". However, what do you use if you don't want a p-value for a sample itself, but instead want to get a *p-value for the likelihood that just "one observation" could have its distance from a sample just by chance*? Context for my question: Many of us know about the Casey Anthony case, and how the medical examiner said they looked at the records and 100% of all drownings were reported within one hour. It wasn't until a month after when it was finally reported to the police the girl was missing by the grandmother and even longer after that when Casey finally claimed it was really a drowning rather than a "Zanny the Nanny" kidnapping the little girl. So, I want to write the medical examiner to see if I can get a list of how long it took for each of the drownings to be reported (she mentioned in court), then calculate a standard deviation and based on the sample size come up with a p-value for when Cindy Anthony finally reported the grand daughter missing 31 days later. Then another p-value for when Casey Anthony finally claimed it was a drowning years later. How would you calculate a p-value for something like this? I'm guessing the sample will probably not be normally distributed, so what would I use from R if that's case? I'm still quite new to R, so if at all possible don't make your answer too technical. Thanks so much! -- View this message in context: http://r.789695.n4.nabble.com/How-would-you-calculate-this-type-of-p-value-using-R-tp3749115p3749115.html Sent from the R help mailing list archive at Nabble.com.
Patrick Breheny
2011-Aug-18 11:55 UTC
[R] How would you calculate this type of p-value using R?
On 08/17/2011 12:32 AM, RQuestion wrote:> Let's say you want to compare "one observation" with a sample, how would you > use R to get a p-value for that single observation itself?This is a rather vague question, but you seem to be describing the calculation of tail probabilities. If, for example, you expected the distribution to be normal with mean 10 and SD 5, and then observed 23, the (one-sided) 'p-value' would be > 1-pnorm(23,mean=10,sd=5) [1] 0.004661188 If you did not wish to assume a distribution (i.e., use the empirical distribution), the 'p-value' would simply be the fraction of cases in your sample as large or larger than the observation in question. -- Patrick Breheny Assistant Professor Department of Biostatistics Department of Statistics University of Kentucky