[R] ACE and AVAS
Thomas Lumley
tlumley at u.washington.edu
Mon May 13 18:47:27 CEST 2002
On Sun, 12 May 2002, Niels Waller wrote:
>
> Hello,
>
> I would like to perform a monotone transformation of y (my response
> variable) to achieve additivity.
> My model is as follows
>
> y~X+items
>
> I do not want to transform X or items (both of these variables are factors)
>
> > X
> [1] 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4
> 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 7 7 7 7 7 7
> [61] 7 7 7 8 8 8 8 8 8 8 8 8
> Levels: 1 2 3 4 5 6 7 8
> > items
> [1] 6 6 6 6 6 6 6 6 1 1 1 1 1 1 1 1 8 8 8 8 8 8 8 8 7 7 7 7 7 7 7 7 4 4 4 4
> 4 4 4 4 9 9 9 9 9 9 9 9 2 2 2 2 2 2 2 2 3 3 3 3
> [61] 3 3 3 3 5 5 5 5 5 5 5 5
> Levels: 1 2 3 4 5 6 7 8 9
> > y
> [1] 0.00 0.00 0.00 0.00 0.00 0.00 0.27 0.00 0.73 0.06 0.04 0.04 0.19 0.06
> 0.23 0.51 0.21 0.64 0.07 0.15 0.08 0.39 0.18 0.33
> [25] 0.61 0.52 0.67 0.18 0.24 0.12 0.40 0.52 0.51 0.64 0.68 0.79 0.13 0.33
> 0.30 0.51 0.73 0.68 0.68 0.84 0.78 0.13 0.28 0.64
> [49] 0.58 0.95 0.91 0.77 0.97 0.78 0.17 0.47 0.85 0.82 1.00 0.93 0.90 0.97
> 0.90 0.17 0.85 1.00 0.98 1.00 1.00 1.00 1.00 1.00
>
>
> I have several questions:
>
> (1) if I combine X and items by cbind(X,items) I loose their factor status.
> Obviously I should be doing something else.
ace() and avas() don't know about factors, and you can't put factors into
matrices. If you construct a set of indicator variables you could put
them into a matrix.
> (2) I do not appear to be interpreting the help file correctly. I thought
> that if I only wanted to transform y then I would say
>
> XX<-cbind(X,items)
> ace(XX,y,mon=0)
No. All the variables are transformed. You probably want to use lin= to
specify linear transformations, equivalent to regression without
transforming.
You'd probably be better off with avas() than ace() -- it's designed to
give additivity and variance stabilisation, which seems to be what you
want for that sort of regression model
>
> (3) The function returns a value called $z - but this value is not
> documented. What is it?
Random junk from the fortran computations. That's why it's not documented.
Yes, it probably should be removed.
-thomas
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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