[R] Storing data from a test as a vector or matrix

Ivan Calandra ivan.calandra at uni-hamburg.de
Wed May 4 16:52:45 CEST 2011


Hi,

I would suggest you to check the structure of your summary object with 
str(), like this:
S <- summary(M, test="Pillai")
str(S)

You will then see how to access each element of it.
If you cannot manage to do it yourself, then provide an example, or at 
least the output from str(s).
By the way, when you get an error, then copy it so that we have a better 
idea of what happens.

HTH,
Ivan




Le 5/4/2011 15:55, wwreith a écrit :
> I just finished a MANOVA test and got the following output:
>
>> summary(M, test="Pillai")
>                  Df Pillai approx F num Df den Df    Pr(>F)
> as.factor(X)   3 1.1922   6.5948     36    360<  2.2e-16 ***
> Residuals      129
> ---
> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
>
>
> I would like to store the values Df=3, Pillai=1.1922, P-value, etc. as a
> vector.
>
> I have tried the following code that did not work:
>
>> S=summary(M, test="Pillai")
>> S1<-as.vector(S$Df, S$Pillai)
> but I am getting an error every time. I have also tried just S$Df. Is there
> a way to find out if "Df" and "Pillai" are correct headers to reference. For
> example maybe it is "df" or "degreesfreedom" etc.
>
> I know the concept works because I have used it for logistic regression.
>
>   >v1<- as.vector(exp(L1$coefficients))
>
> The difference is that I know "coefficients" is the correct header to refer
> to.
>
> --
> View this message in context: http://r.789695.n4.nabble.com/Storing-data-from-a-test-as-a-vector-or-matrix-tp3495626p3495626.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> 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.
>

-- 
Ivan CALANDRA
PhD Student
University of Hamburg
Biozentrum Grindel und Zoologisches Museum
Abt. Säugetiere
Martin-Luther-King-Platz 3
D-20146 Hamburg, GERMANY
+49(0)40 42838 6231
ivan.calandra at uni-hamburg.de

**********
http://www.for771.uni-bonn.de
http://webapp5.rrz.uni-hamburg.de/mammals/eng/1525_8_1.php



More information about the R-help mailing list