SV: [R] How to create unique factor from two factors? + Boostrap Q
Thomas Holm
thomas at holm.cn
Sun Nov 9 23:26:59 CET 2003
Well!
Isn´t that what Copulas is all about.
Fitting multifactor models into one model
/T
Thomas Holm
Södra Hesperiagatan 32A9
00100 Helsingfors
thomas at holm.cn
-----Ursprungligt meddelande-----
Från: r-help-bounces at stat.math.ethz.ch
[mailto:r-help-bounces at stat.math.ethz.ch] För Peter Dalgaard
Skickat: den 9 november 2003 23:56
Till: Prof Brian Ripley
Kopia: r-help at stat.math.ethz.ch; Scott Norton; kjetil at entelnet.bo
Ämne: Re: [R] How to create unique factor from two factors? + Boostrap Q
Prof Brian Ripley <ripley at stats.ox.ac.uk> writes:
> Well, it is one of those things
>
> -- it works in R but not in S
> -- it appears in the examples for help(":") but is not otherwise mentioned
> on the help page (why?)
> -- it does not give a numerical list of combinations, as asked for
> -- it does give unused levels, which in this application is disastrous.
>
> so I at least do not find it `easier'.
>
> > a <- factor(letters)[1:6]
> > b <- factor(rep(letters[1:3], each=2))
> > a:b
> [1] a:a b:a c:b d:b e:c f:c
> 78 Levels: a:a a:b a:c b:a b:b b:c c:a c:b c:c d:a d:b d:c e:a e:b e:c ...
My preference is
> interaction(a,b,drop=TRUE)
[1] a.a b.a c.b d.b e.c f.c
Levels: a.a b.a c.b d.b e.c f.c
This is in Splus too, is documented, and has the possibility of
excluding unused levels. (I'm fairly sure, btw, that we decided to
standardize the :/. thing, but it seems to have been forgotten). It
doesn't give a numerically labeled result, but did Scott really want
that? (as.integer or levels(x) <- seq(along=levels(x)) will get you
there soon enough).
--
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 at stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
###########################################
This message has been scanned by F-Secure Anti-Virus for Internet Mail.
For more information, connect to http://www.F-Secure.com/
More information about the R-help
mailing list