Asan Ramzan
2011-Feb-02 19:40 UTC
[R] unequally spaced factor levels orthogonal polynomial contrasts coefficients trend analysis
Hello [R]-help I am trying to find> a package where you can do ANOVA based trend analysis on grouped data > using orthogonal polynomial contrasts coefficients, for unequally > spaced factor levels. The closest hit I've had is from this web site: >(http://webcache.googleusercontent.com/search?q=cache:xN4K_KGuYGcJ:www.datavis.ca/sasmac/orpoly.html+Orthogonal+polynomial >lbut I cannot find this package or anything like it. [[alternative HTML version deleted]]
RICHARD M. HEIBERGER
2011-Feb-02 22:38 UTC
[R] unequally spaced factor levels orthogonal polynomial contrasts coefficients trend analysis
polynomial contrasts with the scores argument should do what you want. ?contr.poly As an example: contr.poly(4, c(1,2,4,8)) diff(contr.poly(4, c(1,2,4,8))[,1]) On Wed, Feb 2, 2011 at 2:40 PM, Asan Ramzan <asanramzan@yahoo.com> wrote:> Hello [R]-help > > I am trying to find > > a package where you can do ANOVA based trend analysis on grouped data > > using orthogonal polynomial contrasts coefficients, for unequally > > spaced factor levels. The closest hit I've had is from this web site: > >( > http://webcache.googleusercontent.com/search?q=cache:xN4K_KGuYGcJ:www.datavis.ca/sasmac/orpoly.html+Orthogonal+polynomial > >l > > but I cannot find this package or anything like it. > > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@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<http://www.r-project.org/posting-guide.html> > and provide commented, minimal, self-contained, reproducible code. >[[alternative HTML version deleted]]
Greg Snow
2011-Feb-02 22:46 UTC
[R] unequally spaced factor levels orthogonal polynomial contrasts coefficients trend analysis
If you know the spacing between the factor levels, then why not just treat it as a numeric vector and use the poly function to create orthogonal polynomials of the numeric variable. If you have an unequally spaced ordered factor that does not lend itself to the above, then I don't see that any type of polynomial contrasts makes sense and would use something else that does (comparing neighboring pairs maybe). -- 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 Asan Ramzan > Sent: Wednesday, February 02, 2011 12:41 PM > To: r-help at r-project.org > Subject: [R] unequally spaced factor levels orthogonal polynomial > contrasts coefficients trend analysis > > Hello [R]-help > > I am trying to find > > a package where you can do ANOVA based trend analysis on grouped data > > using orthogonal polynomial contrasts coefficients, for unequally > > spaced factor levels. The closest hit I've had is from this web site: > >(http://webcache.googleusercontent.com/search?q=cache:xN4K_KGuYGcJ:www > .datavis.ca/sasmac/orpoly.html+Orthogonal+polynomial > >l > > but I cannot find this package or anything like it. > > > > [[alternative HTML version deleted]] > > ______________________________________________ > 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.