[R] multivariate analysis by using lme
hadley wickham
h.wickham at gmail.com
Mon Aug 21 21:14:19 CEST 2006
> Only after doing the best I could with univariate modeling would
> I then consider multivariate modeling. And then I'd want to think very
> carefully about whether the multivariate model(s) under consideration
> seemed consistent with the univariate results -- and what else they
> might tell me that I hadn't already gotten from the univariate model.
> If you've already done all this, I'm impressed. In the almost 30 years
> since I realized I should try univariate models first and work up to
> multivariate whenever appropriate, I've not found one application where
> the extra effort seemed justified. R has made this much easier, but I'm
> still looking for that special application that would actually require
> the multivariate tools.
To add to Spencer's comments, I'd strongly recommend you look at your
data before trying to model it. The attached graph, a scatterplot of
res1 vs res2 values conditional on c1 and c2, with point shape given
by inter, reveals many interesting features of your data:
* res1 and res2 values are highly correlated
* inter is constant for a given c1 and c2
* there are between 1 and 3 points for each level of inter - not very
many and I don't think enough to investigate what the effect of inter
is
The plot was created using the following code:
library(ggplot)
s <- read.table("~/Desktop/sample.txt", header=T)
s <- rename(s, c(two="value"))
s$res2 <- NULL
s <- as.data.frame(cast(s, ... ~ res1))
qplot(X0, X1, c1 ~ c2, data=s, shape=factor(inter))
(note that you will need the latest version of ggplot available from
http://had.co.nz/ggplot)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graph.pdf
Type: application/pdf
Size: 18475 bytes
Desc: not available
Url : https://stat.ethz.ch/pipermail/r-help/attachments/20060821/c7572407/attachment.pdf
More information about the R-help
mailing list