[R] Summary Orthogonal Polynomials
Peter Dalgaard BSA
p.dalgaard at biostat.ku.dk
Wed Oct 9 16:56:39 CEST 2002
Douglas Bates <bates at stat.wisc.edu> writes:
> Bill.Venables at CMIS.CSIRO.AU writes:
>
> > In fact I find fractions() useful for a lot of things, somewhat to my
> > surprise.
>
> I did try fractions() on the example that Paul gave, poly(1:4, 3), and
> the result is hard to interpret.
>
> > fractions(poly(1:4, 3))
> 1 2 3
> [1,] -5494877/8191279 1/2 -98209/439204
> [2,] -98209/439204 -1/2 208010/310083
> [3,] 208010/930249 -1/2 -5494877/8191279
> [4,] 208010/310083 1/2 208010/930249
It gets nicer if you square them to get rid of the sqrt(5) factor:
> fractions(poly(1:4, 3)^2)
1 2 3
[1,] 9/20 1/4 1/20
[2,] 1/20 1/4 9/20
[3,] 1/20 1/4 9/20
[4,] 9/20 1/4 1/20
(Anyone want to extend fractions() to deal with square roots as well?)
--
O__ ---- Peter Dalgaard Blegdamsvej 3
c/ /'_ --- Dept. of Biostatistics 2200 Cph. N
(*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list