[R] Standard deviation from MANOVA??

David Winsemius dwinsemius at comcast.net
Mon Aug 27 18:03:55 CEST 2012


On Aug 27, 2012, at 6:37 AM, Jean V Adams wrote:

> Not sure why that is.  You can always use manova() to get the  
> multivariate
> summary statistics and then use individual models to get predictions  
> for
> each response.  For example,
>
> mydata <- data.frame(y1=rnorm(50), y2=rnorm(50), x1=rnorm(50),
> x2=rnorm(50), x3=rnorm(50))
>
> myfit <- manova(cbind(y1, y2) ~ x1 + x2 + x3, data=mydata)
> summary(myfit)
>
> myfit1 <- lm(y1 ~ x1 + x2 + x3, data=mydata)
> myfit2 <- lm(y1 ~ x1 + x2 + x3, data=mydata)

I'm guessing this was supposed to be:
   myfit2 <- lm(y2 ~ x1 + x2 + x3, data=mydata)

> predict(myfit1, se.fit=TRUE)
> predict(myfit2, se.fit=TRUE)

I suppose it is possible that what was desired were the standard  
errors around the fitted mean estimates (which I think is what this  
would deliver), but what was asked were for "standard deviations". I  
admit to being puzzled that `manova` was being thought of as a method,  
since the sample or population standard deviations should be derived  
from three applications of `tapply`. I think BruitishFruit should tell  
us what he means by "... don't get the standard deviation values" in  
sufficient detail that we get an unambiguous description what  
"standard deviations" are being requested. (Or he can pose a small  
test case with the "correct answer".)

>
> Jean
>
>
> BrutishFruit <brutishfruit at hotmail.com> wrote on 08/25/2012 04:09:04  
> PM:
>>
>> Hi,
>> I have problem getting the standard deviation from the manova output.
>>
>> I have used the manova function:          myfit <- manova(cbind(y1,  
>> y2)
> ~ x1
>> + x2 + x3, data=mydata) .
>> I tried to get the predicted values and their standard deviation by
>> using:
>> predict(myfit, type="response", se.fit=TRUE)
>>
>> But the problem is that I don't get the standard deviation values, I
> only
>> get the predicted values for y1 and y2.
>>
>> But if I type:     predict*.lm*(myfit, type="response", se.fit=TRUE)
>> I get the predicted values and standard deviation, but only for y1  
>> (and
>> nothing from y2...).
>>
>> //BF
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> 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.

David Winsemius, MD
Heritage Laboratories
West Hartford, CT




More information about the R-help mailing list