[R] Multivariate response methods question
Gavin Simpson
gavin.simpson at ucl.ac.uk
Thu Jan 3 18:15:45 CET 2008
On Thu, 2008-01-03 at 07:31 -0800, Max wrote:
> Dimitris,
>
> Thankyou for pointing me at those functions. It seems like they're
> limited to only one response variable, unless there's a way of
> inserting multiple responses that I'm unaware of (which could easily be
> true) into the formulas.
You could look at Thomas Yee's VGAM package. It is on CRAN now and
allows multivariate ordinal or nominal responses. Further info is here:
http://www.stat.auckland.ac.nz/~yee/VGAM/
FYI some functions, like lm() allow you to include a multivariate
response just by making the lhs of the formula a matrix or data frame,
like this:
> dat1 <- list(var1 = rnorm(100), var2 = rnorm(100), var3 = rnorm(100))
> mod <- lm(cbind(var1, var2) ~ var3, data = dat1)
> mod
Call:
lm(formula = cbind(var1, var2) ~ var3, data = dat1)
Coefficients:
var1 var2
(Intercept) -0.11580 0.22963
var3 0.10798 0.01773
> summary(mod)
## output omitted
But the fitting function has to handle accommodate such data, getting
the formula right is the simple part once you know how.
Without knowing the mentioned functions in detail, I don't recall that
they allow multivariate responses, but I am happy to be corrected from
those that know these better.
HTH
G
>
> Thanks,
>
> -Max
>
>
>
> After serious thinking Dimitris Rizopoulos wrote :
> > you can have a look at the following functions:
> >
> > help("polr", package = "MASS")
> > help("lrm", package = "Design")
> > help("multinom", package = "nnet")
> >
> >
> > I hope it helps.
> >
> > Best,
> > Dimitris
> >
> > ----
> > Dimitris Rizopoulos
> > Ph.D. Student
> > Biostatistical Centre
> > School of Public Health
> > Catholic University of Leuven
> >
> > Address: Kapucijnenvoer 35, Leuven, Belgium
> > Tel: +32/(0)16/336899
> > Fax: +32/(0)16/337015
> > Web: http://med.kuleuven.be/biostat/
> > http://www.student.kuleuven.be/~m0390867/dimitris.htm
> >
> >
> > ----- Original Message -----
> > From: "Max" <mnevill at exitcheck.net>
> > To: <r-help at stat.math.ethz.ch>
> > Sent: Wednesday, January 02, 2008 9:36 PM
> > Subject: [R] Multivariate response methods question
> >
> >
> >> Hi Everyone,
> >>
> >> I have some data that predicts both a nominal and ordinal response
> >> variable. I was wondering what packages in R would help me analyze
> >> the
> >> data?
> >>
> >> I was also curious if anyone could recomend me some textbooks that
> >> would help with the analysis of such data? I have the 5th edition of
> >> "Applied Multivariate Statistical Analysis" by Richard A. Johnson
> >> and
> >> Dean W. Wichern already, but that doesn't seem to cover the material
> >> I'm looking for.
> >>
> >> Thanks,
> >>
> >> -Max
> >>
> >> ______________________________________________
> >> 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.
> >>
> >
> >
> > Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm
> >
> > ______________________________________________
> > 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.
>
> ______________________________________________
> 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.
--
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
Dr. Gavin Simpson [t] +44 (0)20 7679 0522
ECRC, UCL Geography, [f] +44 (0)20 7679 0565
Pearson Building, [e] gavin.simpsonATNOSPAMucl.ac.uk
Gower Street, London [w] http://www.ucl.ac.uk/~ucfagls/
UK. WC1E 6BT. [w] http://www.freshwaters.org.uk
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
More information about the R-help
mailing list