[R] Beginner's question about ptrend. What package to use in R and a general explanation of the statistics.

David Winsemius dwinsemius at comcast.net
Mon Oct 17 16:35:38 CEST 2011


On Oct 17, 2011, at 8:04 AM, Sarah Goslee wrote:

> Hi,
>
> On Sun, Oct 16, 2011 at 6:24 PM, Bob Briggs <rbriggs1 at hotmail.com>  
> wrote:
>>
>> Hello
>>
>> I'm wanting to understand more about ptrend (a statistical  
>> explanation via an internet website if possible) and also to know  
>> what package in R would produce a ptrend.
>>
>>
>> Appreciate any help I can get on this as I'm trying to read and  
>> understand an epidemiological paper and data and reproduce similar  
>> results for my own understanding.
>
> Given that I'm not an epidemiologist, and have no idea what a ptrend
> is, and that you didn't actually explain what kind of beast it might
> be:

It seems likely that it is a test for linear trend in odds ratios or  
rate ratios in an ordered set of proportions. It was taught us  
(epidemiologists) in the courses before we got our hands on logistic  
regression. In my training it was called the Cochran-Armitage test for  
trend:

http://en.wikipedia.org/wiki/Cochran-Armitage_test_for_trend

You get such test when you use prop.trend.test {stats}.

  It is basically a linear regression (or a Pearson correlation) with  
a "chi-square test" using the weighted departures of counts in cells  
from an expected value set by the overall proportion. (Look at the  
code for prop.trend.test.  It makes perfect sense that a set of  
squared departures from an expected value set by the mean could be  
cast as a "chi-square test".) I do not know of any advantages for the  
test over logistic regression or Poisson regression. You can take an  
ordered factor (or a non-ordered on if the levels are properly set up,  
coerce to numeric and do logistic regression with the numeric result  
and get pretty much the same result, and you would be doing so in the  
context of a much more flexible modeling environment. So I see it  
mainly as of historical interest, something to use when you only have  
a device that cannot run R.

-- 
David.

>
> If you go to http://www.rseek.org and search for ptrend, you will get
> several R packages that use that term, a few posts from the R-help
> list, and a pile of websites that might be helpful.
>

>
> Sarah
>
>
>> Thanks
>> Meredith

David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list